(__argp_fmtstream_update): Correct off-by-one in wordwrap algorithm
authordrepper <drepper>
Fri, 31 Jul 1998 17:59:54 +0000 (17:59 +0000)
committerdrepper <drepper>
Fri, 31 Jul 1998 17:59:54 +0000 (17:59 +0000)
when there' a space at the beginning of the buffer.

argp/argp-fmtstream.c

index 05e9e21..1649f15 100644 (file)
@@ -213,10 +213,10 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
          if (nextline > buf)
            {
              /* Swallow separating blanks.  */
-             if (p > buf)
+             if (p >= buf)
                do
                  --p;
-               while (p > buf && isblank (*p));
+               while (p >= buf && isblank (*p));
              nl = p + 1;       /* The newline will replace the first blank. */
            }
          else