SYSCF/PANICLOG fix (trunk only)
files.c wouldn't compile if SYSCF was defined and PANICLOG wasn't. Also, a couple of PANICLOG option sanity checks treated 0 as an error but then said that the value had to be 0, 1, or 2. I went with the message and changed it to treat 0 as ok. Unfortunately the numeric value is derived via atoi() so you get 0 from bogus input. Perhaps it should use sscanf(string,"%d%c",&number,&dummy)==1 to try harder to make sure it actually gets a number.
This commit is contained in:
+11
-7
@@ -2138,18 +2138,21 @@ int src;
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sysopt.pointsmin = temp;
|
sysopt.pointsmin = temp;
|
||||||
#ifdef PANICTRACE_GLIBC
|
# ifdef PANICTRACE
|
||||||
} else if ( (src==SET_IN_SYS) && match_varname(buf, "PANICTRACE_GLIBC", 16)) {
|
# ifdef PANICTRACE_GLIBC
|
||||||
|
} else if (src == SET_IN_SYS &&
|
||||||
|
match_varname(buf, "PANICTRACE_GLIBC", 16)) {
|
||||||
int temp = atoi(bufp);
|
int temp = atoi(bufp);
|
||||||
if(temp < 1 || temp > 2){
|
if (temp < 0 || temp > 2) {
|
||||||
raw_printf("Illegal value in PANICTRACE_GLIBC (not 0,1,2).");
|
raw_printf("Illegal value in PANICTRACE_GLIBC (not 0,1,2).");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
sysopt.panictrace_glibc = temp;
|
sysopt.panictrace_glibc = temp;
|
||||||
#endif
|
# endif /* PANICTRACE_GLIBC */
|
||||||
} else if ( (src==SET_IN_SYS) && match_varname(buf, "PANICTRACE_GDB", 14)) {
|
} else if (src == SET_IN_SYS &&
|
||||||
|
match_varname(buf, "PANICTRACE_GDB", 14)) {
|
||||||
int temp = atoi(bufp);
|
int temp = atoi(bufp);
|
||||||
if(temp < 1 || temp > 2){
|
if (temp < 0 || temp > 2) {
|
||||||
raw_printf("Illegal value in PANICTRACE_GDB (not 0,1,2).");
|
raw_printf("Illegal value in PANICTRACE_GDB (not 0,1,2).");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2162,7 +2165,8 @@ int src;
|
|||||||
if(sysopt.greppath) free(sysopt.greppath);
|
if(sysopt.greppath) free(sysopt.greppath);
|
||||||
sysopt.greppath = (char*)alloc(strlen(bufp)+1);
|
sysopt.greppath = (char*)alloc(strlen(bufp)+1);
|
||||||
Strcpy(sysopt.greppath, bufp);
|
Strcpy(sysopt.greppath, bufp);
|
||||||
#endif
|
# endif /* PANICTRACE */
|
||||||
|
#endif /* SYSCF */
|
||||||
} else if (match_varname(buf, "BOULDER", 3)) {
|
} else if (match_varname(buf, "BOULDER", 3)) {
|
||||||
(void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
|
(void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
|
||||||
1, "BOULDER");
|
1, "BOULDER");
|
||||||
|
|||||||
Reference in New Issue
Block a user