diff options
author | jkh <jkh@FreeBSD.org> | 1997-02-16 10:20:05 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-02-16 10:20:05 +0000 |
commit | 7b21a52ead94765324be59377131ba1a72f6ad77 (patch) | |
tree | f7577c0b818e4ee7be4e9cfa1a01b92a7463e2cb | |
parent | c2de35bae3d7dc504eea508c317836bb86e42f73 (diff) | |
download | FreeBSD-src-7b21a52ead94765324be59377131ba1a72f6ad77.zip FreeBSD-src-7b21a52ead94765324be59377131ba1a72f6ad77.tar.gz |
Replace bogus strncmp() with strcmp().
-rw-r--r-- | release/sysinstall/config.c | 5 | ||||
-rw-r--r-- | usr.sbin/sade/config.c | 5 | ||||
-rw-r--r-- | usr.sbin/sysinstall/config.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index fafd78c..cb43a6b 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -376,11 +376,14 @@ configSysconfig(char *config) /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { + char line[512]; + for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) continue; - if (!strncmp(lines[i], v->name, cp - lines[i])) { + sstrncpy(line, lines[i], cp - lines[i]); + if (!strcmp(line, v->name)) { free(lines[i]); lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + 5); sprintf(lines[i], "%s=\"%s\"\n", v->name, v->value); diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index fafd78c..cb43a6b 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/config.c @@ -376,11 +376,14 @@ configSysconfig(char *config) /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { + char line[512]; + for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) continue; - if (!strncmp(lines[i], v->name, cp - lines[i])) { + sstrncpy(line, lines[i], cp - lines[i]); + if (!strcmp(line, v->name)) { free(lines[i]); lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + 5); sprintf(lines[i], "%s=\"%s\"\n", v->name, v->value); diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index fafd78c..cb43a6b 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -376,11 +376,14 @@ configSysconfig(char *config) /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { + char line[512]; + for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) continue; - if (!strncmp(lines[i], v->name, cp - lines[i])) { + sstrncpy(line, lines[i], cp - lines[i]); + if (!strcmp(line, v->name)) { free(lines[i]); lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + 5); sprintf(lines[i], "%s=\"%s\"\n", v->name, v->value); |