diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-08 02:07:08 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-08 02:07:08 +0100 |
commit | 41a751c90c9d39db764308aeba476db593b9b6e1 (patch) | |
tree | a681cb4ed2a5a89d4aa30dd130b8ccad3379ad88 /Userland/kill.cpp | |
parent | 71a2942a0a81a53831ade3c6dec106caafd29c5b (diff) | |
download | serenity-41a751c90c9d39db764308aeba476db593b9b6e1.zip |
Minor tweak to /bin/kill.
Diffstat (limited to 'Userland/kill.cpp')
-rw-r--r-- | Userland/kill.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Userland/kill.cpp b/Userland/kill.cpp index 10cc9c1b62..7da6429270 100644 --- a/Userland/kill.cpp +++ b/Userland/kill.cpp @@ -6,6 +6,10 @@ static unsigned parseUInt(const String& str, bool& ok) { + if (str.isEmpty()) { + ok = false; + return 0; + } unsigned value = 0; for (size_t i = 0; i < str.length(); ++i) { if (str[i] < '0' || str[i] > '9') { @@ -38,13 +42,13 @@ int main(int argc, char** argv) print_usage_and_exit(); signum = parseUInt(&argv[1][1], ok); if (!ok) { - printf("%s is not a valid signal number\n", &argv[1][1]); + printf("'%s' is not a valid signal number\n", &argv[1][1]); return 2; } } unsigned pid = parseUInt(argv[pid_argi], ok); if (!ok) { - printf("%s is not a valid PID\n", argv[pid_argi]); + printf("'%s' is not a valid PID\n", argv[pid_argi]); return 3; } |