mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-01-31 18:09:16 +01:00
Fix a small bug when parsing the padding command line argument (-p)
When an empty string was passed as padding spec, this was not properly flagged as an error.
This commit is contained in:
parent
84d051f1e5
commit
eab1e13df2
@ -344,10 +344,11 @@ static int killblank(opt_t *result, char *optarg)
|
||||
*/
|
||||
static int padding(opt_t *result, char *optarg)
|
||||
{
|
||||
int errfl = 0;
|
||||
int errfl = 1;
|
||||
char *p = optarg;
|
||||
|
||||
while (*p) {
|
||||
errfl = 0;
|
||||
if (p[1] == '\0') {
|
||||
errfl = 1;
|
||||
break;
|
||||
@ -395,7 +396,7 @@ static int padding(opt_t *result, char *optarg)
|
||||
}
|
||||
}
|
||||
if (errfl) {
|
||||
fprintf(stderr, "%s: invalid padding specification - %s\n", PROJECT, optarg);
|
||||
bx_fprintf(stderr, "%s: invalid padding specification - %s\n", PROJECT, optarg);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user