Skip to content

Commit

Permalink
va_system(): rename buffer variable and make buffer size a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hoijui authored and abishekvashok committed Jan 24, 2018
1 parent b5c2543 commit 66a0be3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmatrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ volatile sig_atomic_t signal_status = 0; /* Indicates a caught signal */
int va_system(char *str, ...) {

va_list ap;
char foo[133];
static const unsigned int buf_size = 133;
char buf[buf_size];

va_start(ap, str);
vsnprintf(foo, 132, str, ap);
vsnprintf(buf, buf_size - 1, str, ap);
va_end(ap);
return system(foo);
return system(buf);
}

/* What we do when we're all set to exit */
Expand Down

0 comments on commit 66a0be3

Please sign in to comment.