Skip to content

Commit 555fb1d

Browse files
committed
add check that string options are not provided with empty strings
1 parent e291e53 commit 555fb1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/pgut.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,10 @@ assign_option(pgut_option *opt, const char *optarg, pgut_optsrc src)
241241
if (orig_source != SOURCE_DEFAULT)
242242
free(*(char **) opt->var);
243243
*(char **) opt->var = pgut_strdup(optarg);
244-
return;
244+
if (strcmp(optarg,"") != 0)
245+
return;
246+
message = "a valid string. But provided: ";
247+
break;
245248
case 't':
246249
if (parse_time(optarg, opt->var))
247250
return;

0 commit comments

Comments
 (0)