Index: lib/libcam/scsi_cmdparse.c =================================================================== --- lib/libcam/scsi_cmdparse.c +++ lib/libcam/scsi_cmdparse.c @@ -131,14 +131,14 @@ *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ } \ - field_name[0] = 0; \ + field_name[0] = '\0'; \ suppress = 0; \ } while (0) u_char bits = 0; /* For bit fields */ int shift = 0; /* Bits already shifted out */ suppress = 0; - field_name[0] = 0; + field_name[0] = '\0'; while (!done) { switch(letter = *fmt) { @@ -172,9 +172,9 @@ fmt++; } - if (fmt) + if (*fmt == '\0') fmt++; /* Skip '}' */ - field_name[i] = 0; + field_name[i] = '\0'; break; } @@ -249,7 +249,7 @@ width = strtol(fmt, &intendp, 10); fmt = intendp; if (!suppress) { - if (arg_put) + if (arg_put != NULL) (*arg_put)(puthook, (letter == 't' ? 'b' : letter), databuf, width, field_name); @@ -262,13 +262,13 @@ for (p = dest + width - 1; (p >= (char *)dest) && (*p == ' '); p--) - *p = 0; + *p = '\0'; } } assigned++; } databuf += width; - field_name[0] = 0; + field_name[0] = '\0'; suppress = 0; break; @@ -373,22 +373,22 @@ field_size = 8; /* Default to byte field type... */ *fmt = 'i'; field_width = 1; /* 1 byte wide */ - if (name) - *name = 0; + if (name != NULL) + *name = '\0'; state = BETWEEN_FIELDS; while (state != DONE) { switch(state) { case BETWEEN_FIELDS: - if (*p == 0) + if (*p == '\0') state = DONE; else if (isspace(*p)) p++; else if (*p == '#') { while (*p && *p != '\n') p++; - if (p) + if (*p != '\0') p++; } else if (*p == '{') { int i = 0; @@ -404,7 +404,7 @@ } if(name && i < n_name) - name[i] = 0; + name[i] = '\0'; if (*p == '}') p++; @@ -562,7 +562,7 @@ if (suppress) value = 0; else - value = arg_get ? + value = arg_get != NULL ? (*arg_get)(gethook, field_name) : va_arg(*ap, int); } @@ -666,8 +666,8 @@ va_start(ap, fmt); - retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0, - fmt, &ap); + retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, + NULL, NULL, fmt, &ap); va_end(ap); @@ -699,7 +699,7 @@ va_start(ap, fmt); - retval = do_buff_decode(buff, len, 0, 0, fmt, &ap); + retval = do_buff_decode(buff, len, NULL, NULL, fmt, &ap); va_end(ap); @@ -813,7 +813,8 @@ va_start(ap, fmt); - retval = do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, &ap); + retval = do_encode(csio->data_ptr, csio->dxfer_len, NULL, NULL, NULL, + fmt, &ap); va_end(ap); @@ -832,7 +833,7 @@ if (arg_get == NULL) return(-1); - return (do_encode(buff, len, 0, arg_get, gethook, fmt, NULL)); + return (do_encode(buff, len, NULL, arg_get, gethook, fmt, NULL)); } int @@ -847,6 +848,6 @@ if (arg_get == NULL) return(-1); - return (do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, + return (do_encode(csio->data_ptr, csio->dxfer_len, NULL, arg_get, gethook, fmt, NULL)); }