Made configuring column size easier
This commit is contained in:
parent
b7a6b41b38
commit
07e65019bc
2 changed files with 21 additions and 14 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <limits.h>
|
||||
#include <getopt.h>
|
||||
#include "macros.h"
|
||||
#include "config.h"
|
||||
|
|
@ -131,10 +132,14 @@ int main( int argc, char *argv[] ){
|
|||
fprintf( stderr, "ERR: AMOUT OF ROWS MUST BE AT LEAST 1\n" );
|
||||
return -1;
|
||||
}
|
||||
if( playboard.rows >= 32 ){
|
||||
fprintf( stderr, "ERR: AMOUT OF ROWS MUST BE LESS THAN 32\n" );
|
||||
#define ROWOVERFLOW ( sizeof(column_t) * CHAR_BIT )
|
||||
if( playboard.rows >= ROWOVERFLOW ){
|
||||
fprintf( stderr,
|
||||
"ERR: AMOUT OF ROWS MUST BE LESS THAN %d\n", (int)ROWOVERFLOW
|
||||
);
|
||||
return -1;
|
||||
}
|
||||
#undef ROWOVERFLOW
|
||||
// Start the actual program
|
||||
printf(
|
||||
VERSIONSTRING
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue