diff options
author | Dave Davenport <qball@gmpclient.org> | 2015-08-04 09:42:14 +0200 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2015-08-04 09:42:14 +0200 |
commit | 1ca7141621817cd277e2c117819bcf4c66d88190 (patch) | |
tree | b2c3d25631a3f1dfe0a3ebd8c991ee0003463354 /source/helper.c | |
parent | 7e9ac526b54ce3b35ad292a4e091d25d75e47eef (diff) |
Add quick solution for #202, expose line-margin setting.
Diffstat (limited to 'source/helper.c')
-rw-r--r-- | source/helper.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/helper.c b/source/helper.c index 3e7db9ad..225f89bf 100644 --- a/source/helper.c +++ b/source/helper.c @@ -448,7 +448,7 @@ void remove_pid_file ( int fd ) { if ( fd >= 0 ) { if ( close ( fd ) ) { - fprintf(stderr, "Failed to close pidfile: '%s'\n", strerror(errno)); + fprintf ( stderr, "Failed to close pidfile: '%s'\n", strerror ( errno ) ); } } } @@ -486,6 +486,12 @@ void config_sanity_check ( ) config.location = WL_CENTER; found_error = 1; } + if ( !( config.line_margin >= 3 && config.line_margin <= 50 ) ) { + g_string_append_printf ( msg, "\t<b>config.line_margin</b>=%d is invalid. Value should be between %d and %d.\n", + config.line_margin, 3, 50 ); + config.line_margin = 3; + found_error = 1; + } if ( found_error ) { g_string_append ( msg, "Please update your configuration." ); show_error_message ( msg->str, TRUE ); |