Source-Changes-HG archive

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

[src-draft/trunk]: src/tests/lib/libcurses/director Simplify



details:   https://anonhg.NetBSD.org/src-all/rev/6bc7f2003803
branches:  trunk
changeset: 952772:6bc7f2003803
user:      Joerg Sonnenberger <joerg%bec.de@localhost>
date:      Tue Feb 16 02:58:51 2021 +0100

description:
Simplify

diffstat:

 tests/lib/libcurses/director/testlang_parse.y |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (15 lines):

diff -r 00e3c6d7a9d8 -r 6bc7f2003803 tests/lib/libcurses/director/testlang_parse.y
--- a/tests/lib/libcurses/director/testlang_parse.y     Tue Feb 16 02:57:20 2021 +0100
+++ b/tests/lib/libcurses/director/testlang_parse.y     Tue Feb 16 02:58:51 2021 +0100
@@ -1388,10 +1388,8 @@
                free(input_str);
        }
 
-       if ((input_str = malloc(strlen(s) + 1)) == NULL)
+       if ((input_str = strdup(s)) == NULL)
                err(2, "Cannot allocate memory for input string");
-
-       strlcpy(input_str, s, strlen(s) + 1);
 }
 
 static void



Home | Main Index | Thread Index | Old Index