use verbosity flag

This commit is contained in:
tth 2019-11-01 11:37:35 +01:00
parent af13698209
commit 134f3170f6

View File

@ -35,7 +35,7 @@ fprintf(stderr, ">>> %s ( '%s' %p )\n", __func__, line, sref);
*/ */
ptr = strtok(line, "|"); ptr = strtok(line, "|");
cp = ltrim(rtrim(ptr)); cp = ltrim(rtrim(ptr));
fprintf(stderr, "key [%s]\n", cp); if (verbosity) fprintf(stderr, "key [%s]\n", cp);
if ( ! isalpha(*cp)) { if ( ! isalpha(*cp)) {
fprintf(stderr, "invalid key 0x%02x\n", *cp); fprintf(stderr, "invalid key 0x%02x\n", *cp);
return -2; return -2;
@ -48,7 +48,7 @@ if (NULL==ptr) {
return -3; return -3;
} }
cp = ltrim(rtrim(ptr)); cp = ltrim(rtrim(ptr));
fprintf(stderr, "text [%s]\n", cp); if (verbosity) fprintf(stderr, "text [%s]\n", cp);
if (strlen(cp) > SZ_TEXT) { if (strlen(cp) > SZ_TEXT) {
fprintf(stderr, "text too long\n"); fprintf(stderr, "text too long\n");
return -4; return -4;
@ -60,7 +60,7 @@ if (NULL==ptr) {
fprintf(stderr, "line to short\n"); fprintf(stderr, "line to short\n");
return -6; return -6;
} }
fprintf(stderr, "path [%s]\n", ltrim(rtrim(ptr))); if (verbosity) fprintf(stderr, "path [%s]\n", ltrim(rtrim(ptr)));
if (strlen(ptr) > SZ_TEXT) { if (strlen(ptr) > SZ_TEXT) {
fprintf(stderr, "path too long\n"); fprintf(stderr, "path too long\n");
return -5; return -5;