Print this page
6645 sgsmsg relies on undefined behaviour of loop-scoped variables
@@ -663,10 +663,11 @@
{
char buffer[LINE_MAX], * token;
uint_t bufsize;
char *token_buffer;
int escape = 0;
+ int len = 0;
if ((token_buffer = malloc(LINE_MAX)) == 0) {
(void) fprintf(stderr, Errmsg_nmem, strerror(errno));
return (1);
}
@@ -674,11 +675,10 @@
line = 1;
while ((token = fgets(buffer, LINE_MAX, fddesc)) != NULL) {
char defn[PATH_MAX], * _defn, * str;
- int len;
switch (*token) {
case '#':
case '$':
if (escape) {