]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Sec 2853] Initial work on tests/sec-2853/. Harlan Stenn.
authorHarlan Stenn <stenn@ntp.org>
Thu, 25 Jun 2015 04:26:18 +0000 (04:26 +0000)
committerHarlan Stenn <stenn@ntp.org>
Thu, 25 Jun 2015 04:26:18 +0000 (04:26 +0000)
bk: 558b82eaNzASEksK_izfD_UF_y5eSg

tests/sec-2853/sec-2853.c

index d0d1c622782344fa9be0c50e5bb6d63afabe3528..6499fdf1f85ac24bee1eed38bc531a2cdf512795 100644 (file)
@@ -47,14 +47,13 @@ void test_main( void )
 
 int basic_good( void )
 {
-       const char *string = "good";
+       const char string[] = "good";
        const char *EOstring;
        char *cp;
        size_t len;
        int failed;
 
-       EOstring = string;
-       for (cp = string; *cp++; ++EOstring) ;
+       EOstring = string + sizeof string;
 
        len = remoteconfig_cmdlength(string, EOstring);
 
@@ -98,14 +97,13 @@ int embedded_nul( void )
 
 int trailing_space( void )
 {
-       const char *string = "trailing space ";
+       const char string[] = "trailing space ";
        const char *EOstring;
        char *cp;
        size_t len;
        int failed;
 
-       EOstring = string;
-       for (cp = string; *cp++; ++EOstring) ;
+       EOstring = string + sizeof string;
 
        len = remoteconfig_cmdlength(string, EOstring);