Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/cvs/src Reserve extra byte for terminating '\0' for...



details:   https://anonhg.NetBSD.org/src/rev/e956af4329f2
branches:  trunk
changeset: 498380:e956af4329f2
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sat Oct 21 16:59:39 2000 +0000

description:
Reserve extra byte for terminating '\0' for sscanf buffers. From OpenBSD.

diffstat:

 gnu/dist/cvs/src/rcs.c    |  2 +-
 gnu/dist/cvs/src/update.c |  4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r a71fbbc0e65d -r e956af4329f2 gnu/dist/cvs/src/rcs.c
--- a/gnu/dist/cvs/src/rcs.c    Sat Oct 21 14:10:25 2000 +0000
+++ b/gnu/dist/cvs/src/rcs.c    Sat Oct 21 16:59:39 2000 +0000
@@ -4596,7 +4596,7 @@
        if (info != NULL)
        {
            /* If the size of `devtype' changes, fix the sscanf call also */
-           char devtype[16];
+           char devtype[16+1];
 
            if (sscanf (info->data, "%16s %lu",
                        devtype, &devnum_long) < 2)
diff -r a71fbbc0e65d -r e956af4329f2 gnu/dist/cvs/src/update.c
--- a/gnu/dist/cvs/src/update.c Sat Oct 21 14:10:25 2000 +0000
+++ b/gnu/dist/cvs/src/update.c Sat Oct 21 16:59:39 2000 +0000
@@ -2665,7 +2665,7 @@
            else
            {
                /* If the size of `ftype' changes, fix the sscanf call also */
-               char ftype[16];
+               char ftype[16+1];
                if (sscanf (n->data, "%16s %lu", ftype,
                            &dev_long) < 2)
                    error (1, 0, "%s:%s has bad `special' newphrase %s",
@@ -2738,7 +2738,7 @@
            else
            {
                /* If the size of `ftype' changes, fix the sscanf call also */
-               char ftype[16];
+               char ftype[16+1];
                if (sscanf (n->data, "%16s %lu", ftype,
                            &dev_long) < 2)
                    error (1, 0, "%s:%s has bad `special' newphrase %s",



Home | Main Index | Thread Index | Old Index