AmendHub

Download:

jcs

/

subtext

/

amendments

/

362

settings: Use signed longs for min/max


jcs made amendment 362 about 1 year ago
--- settings.c Thu Mar 2 08:07:38 2023 +++ settings.c Mon Mar 6 17:09:53 2023 @@ -211,14 +211,14 @@ get_input: lval = atol(input); if (lval < sf->min) { session_printf(s, - "%s must be at least %lu (^C to cancel)\r\n", sf->name, + "%s must be %ld or higher (^C to cancel)\r\n", sf->name, sf->min); xfree(&input); goto get_input; } if (lval > sf->max) { session_printf(s, - "%s must be less than %lu (^C to cancel)\r\n", sf->name, + "%s must be %lu or less (^C to cancel)\r\n", sf->name, sf->max); xfree(&input); goto get_input; --- settings.h Tue Feb 28 14:31:19 2023 +++ settings.h Mon Mar 6 17:09:30 2023 @@ -32,8 +32,8 @@ struct struct_field { char name[50]; short type; unsigned short off; - unsigned long min; - unsigned long max; + long min; + long max; }; short struct_editor(struct session *s, const struct struct_field *fields,