1. 23 4月, 2012 4 次提交
  2. 22 4月, 2012 6 次提交
  3. 21 4月, 2012 2 次提交
  4. 20 4月, 2012 3 次提交
  5. 19 4月, 2012 2 次提交
  6. 18 4月, 2012 14 次提交
  7. 17 4月, 2012 9 次提交
    • R
      avoid null pointer dereference on %*p fields in scanf · 03de77f5
      Rich Felker 提交于
      03de77f5
    • R
      also ensure that write buffer is bounded when __stdio_write returns · b7a27617
      Rich Felker 提交于
      assuming other code is correct, this should be a no-op, but better to
      be safe...
      b7a27617
    • R
      fix buffer overflow in vfprintf on long writes to unbuffered files · b5a8b289
      Rich Felker 提交于
      vfprintf temporarily swaps in a local buffer (for the duration of the
      operation) when the target stream is unbuffered; this both simplifies
      the implementation of functions like dprintf (they don't need their
      own buffers) and eliminates the pathologically bad performance of
      writing the formatted output with one or more write syscalls per
      formatting field.
      
      in cases like dprintf where we are dealing with a virgin FILE
      structure, everything worked correctly. however for long-lived files
      (like stderr), it's possible that the buffer bounds were already set
      for the internal zero-size buffer. on the next write, __stdio_write
      would pick up and use the new buffer provided by vfprintf, but the
      bound (wend) field was still pointing at the internal zero-size
      buffer's end. this in turn allowed unbounded writes to the temporary
      buffer.
      b5a8b289
    • R
      fix %lf, etc. with printf · cc3a4466
      Rich Felker 提交于
      the l prefix is redundant/no-op with printf, since default promotions
      always promote floats to double; however, it is valid, and printf was
      wrongly rejecting it.
      cc3a4466
    • R
      better description for errno==0 · 9d2a15a6
      Rich Felker 提交于
      9d2a15a6
    • R
      implement wcstod and family · f94cbdeb
      Rich Felker 提交于
      not heavily tested but these functions appear to work correctly
      f94cbdeb
    • R
      avoid hitting eof in wcstol · a4310aa2
      Rich Felker 提交于
      shunget cannot unget eof status, causing wcstol to leave endptr
      pointing to the wrong place when scanning, for example, L"0x". cheap
      fix is to make the read function provide an infinite stream of bogus
      characters rather than eof. really this is something of a design flaw
      in how the shgetc system is used for strto* and wcsto*; in the long
      term, I believe multi-character unget should be scrapped and replaced
      with a function that can subtract from the f->shcnt counter.
      a4310aa2
    • R
    • R
      new scanf implementation and corresponding integer parser/converter · 18efeb32
      Rich Felker 提交于
      advantages over the old code:
      - correct results for floating point (old code was bogus)
      - wide/regular scanf separated so scanf does not pull in wide code
      - well-defined behavior on integers that overflow dest type
      - support for %[a-b] ranges with %[ (impl-defined by widely used)
      - no intermediate conversion of fmt string to wide string
      - cleaner, easier to share code with strto* functions
      - better standards conformance for corner cases
      
      the old code remains in the source tree, as the wide versions of the
      scanf-family functions are still using it. it will be removed when no
      longer needed.
      18efeb32