summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-09 21:01:08 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-09 21:01:08 +0100
commitea2fba20fc6f537b9224a24ba7a1f923aea045a2 (patch)
treefde8db4fed6e42ced5c796892443ea5c53833c02 /modules
parent7aedcb7447f1bfd10d0c12233594ffb1e0473fbd (diff)
abbrgen: Bugfix for negative inputs.....
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/abbrgen/abbreviation_gen_Darwinbin30896 -> 26480 bytes
-rwxr-xr-xmodules/abbrgen/abbreviation_gen_Linuxbin19364 -> 19392 bytes
-rw-r--r--modules/abbrgen/abbrgen.js5
3 files changed, 3 insertions, 2 deletions
diff --git a/modules/abbrgen/abbreviation_gen_Darwin b/modules/abbrgen/abbreviation_gen_Darwin
index 7fd9596..0781901 100755
--- a/modules/abbrgen/abbreviation_gen_Darwin
+++ b/modules/abbrgen/abbreviation_gen_Darwin
Binary files differ
diff --git a/modules/abbrgen/abbreviation_gen_Linux b/modules/abbrgen/abbreviation_gen_Linux
index dd151e7..fb08831 100755
--- a/modules/abbrgen/abbreviation_gen_Linux
+++ b/modules/abbrgen/abbreviation_gen_Linux
Binary files differ
diff --git a/modules/abbrgen/abbrgen.js b/modules/abbrgen/abbrgen.js
index 64a29b1..ba6248b 100644
--- a/modules/abbrgen/abbrgen.js
+++ b/modules/abbrgen/abbrgen.js
@@ -13,6 +13,7 @@ function get_abbreviations(abbr,num,cb){
console.log(err.toString());
console.log(err.stack);
cb([]);
+ return;
}
cb(stdout.split("\n"));
});
@@ -38,11 +39,11 @@ module.exports=function(app,io,_moddir){
res.send("ERROR: Number of abbreviations too large.");
return;
}
- if(!abbr.match(/^[a-z]+$/i)||isNaN(+num)){
+ if(!abbr.match(/^[a-z]+$/i)||isNaN(+num)||num<0||num%1!=0){
res.send("ERROR: Invalid input values.");
return;
}
- get_abbreviations(abbr,num,function(answers){
+ get_abbreviations(abbr,num|0,function(answers){
res.send(answers.join("\n"));
});
});