Replace bogus strncmp() with strcmp().

This commit is contained in:
jkh 1997-02-16 10:20:05 +00:00
parent c2de35bae3
commit 7b21a52ead
3 changed files with 12 additions and 3 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);