about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-12-27 00:29:20 +0000
committerJames Booth <boothj5@gmail.com>2013-12-27 00:29:20 +0000
commit7a63cf2e22bc0ff11448644f0d739df5cf1f4e67 (patch)
tree0bc7d514f8ed97734f3ebe32899713e0c7ade4da /src
parent9d1b05a8964fd1271e2cbd32cfa8036afd24a7d2 (diff)
downloadprofani-tty-7a63cf2e22bc0ff11448644f0d739df5cf1f4e67.tar.gz
Changed messages on invalid priorities
Diffstat (limited to 'src')
-rw-r--r--src/command/commands.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 67458c79..1797c7ed 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2310,11 +2310,11 @@ _strtoi(char *str, int *saveptr, int min, int max)
 
     errno = 0;
     val = (int)strtol(str, &ptr, 0);
-    if (*str == '\0' || *ptr != '\0') {
-        cons_show("Illegal character. Must be a number.");
+    if (errno != 0 || *str == '\0' || *ptr != '\0') {
+        cons_show("Could not convert \"%s\" to a number.", str);
         return -1;
-    } else if (errno == ERANGE || val < min || val > max) {
-        cons_show("Value out of range. Must be in %d..%d.", min, max);
+    } else if (val < min || val > max) {
+        cons_show("Value %s out of range. Must be in %d..%d.", str, min, max);
         return -1;
     }