@@ -42,16 +42,16 @@ } linebuf_ptr = &linebuf[strlen(linebuf) - 1]; while (*linebuf_ptr < ' ' && linebuf_ptr >= linebuf) { *linebuf_ptr = '\0'; - *linebuf_ptr--; + linebuf_ptr--; } linebuf_ptr = &linebuf[0]; while (*linebuf_ptr == ' ') { - *linebuf_ptr++; + linebuf_ptr++; } if (*linebuf_ptr == '#' || *linebuf_ptr == '\0') { continue; } @@ -59,13 +59,13 @@ sep = strpbrk(linebuf_ptr, " \t"); cmd = linebuf_ptr; if (sep != NULL) { *sep = '\0'; - *sep++; + sep++; while (*sep == ' ' || *sep == '\t') { - *sep++; + sep++; } value = sep; } else { value = NULL; } @@ -73,14 +73,18 @@ save_lc_errno = lc_errno; lc_errno = LC_ERR_NONE; lcpvret = lc_process_var(cmd, NULL, value, LC_FLAGS_VAR); if (lcpvret < 0) { if (lc_errno == LC_ERR_NONE) { - PRINTERR_D("Invalid command: \"%s\"", cmd); +#ifdef DEBUG + fprintf(stderr, "Invalid command: \"%s\"\n", cmd); +#endif lc_errno = LC_ERR_INVCMD; } else { - PRINTERR_D("Error processing command (command was valid, but an error occured, errno was set)"); +#ifdef DEBUG + fprintf(stderr, "Error processing command (command was valid, but an error occured, errno was set)\n"); +#endif } retval = -1; } else { lc_errno = save_lc_errno; }