summaryrefslogtreecommitdiff
path: root/keymash.c
diff options
context:
space:
mode:
authoraxtlos <axtlos@getcryst.al>2024-04-04 23:58:58 +0200
committeraxtlos <axtlos@getcryst.al>2024-04-04 23:58:58 +0200
commit02d5273674d2da06b1808b6d6877ef65c9a936b6 (patch)
tree34935e6882e83535c7d59e4951c998385b9fce9d /keymash.c
parent5e0f40e90bf9b37c96983026f3e56029501f2c37 (diff)
downloadgenkeymash-02d5273674d2da06b1808b6d6877ef65c9a936b6.tar.gz
genkeymash-02d5273674d2da06b1808b6d6877ef65c9a936b6.tar.bz2
Add input checking
Diffstat (limited to '')
-rw-r--r--keymash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/keymash.c b/keymash.c
index d52a413..ab635e9 100644
--- a/keymash.c
+++ b/keymash.c
@@ -16,6 +16,10 @@ main (int argc, char *argv[]) {
return 1;
}
int keymashlength = atoi(argv[1]);
+ if (keymashlength <= 0) {
+ puts("Bad length >:(");
+ return 1;
+ }
char *keymash = malloc(keymashlength+1);
int r,total = 0;
char prev = 'a';