summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2005-10-27 06:59:05 +0000
committerBernhard Reutner-Fischer2005-10-27 06:59:05 +0000
commitee9cf4862060bfd9bc165e6ae6b37bcb978cf7cb (patch)
tree7d95bac975d02194beba3ecde62fb126617746aa /editors
parentc9c959cc7c51fef1bbf22dff2096a87f78176e57 (diff)
downloadbusybox-ee9cf4862060bfd9bc165e6ae6b37bcb978cf7cb.zip
busybox-ee9cf4862060bfd9bc165e6ae6b37bcb978cf7cb.tar.gz
- correct boilerplate
- use bb_xgetlarg for the patch_level to catch invalid arguments.
Diffstat (limited to 'editors')
-rw-r--r--editors/patch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/patch.c b/editors/patch.c
index f283953..bcd3c68 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -3,7 +3,7 @@
* busybox patch applet to handle the unified diff format.
* Copyright (C) 2003 Glenn McGrath <bug1@iinet.net.au>
*
- * Licensed under the GPL v2, see the file LICENSE in this tarball.
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*
* This applet is written to work with patches generated by GNU diff,
* where there is equivalent functionality busybox patch shall behave
@@ -99,7 +99,7 @@ extern int patch_main(int argc, char **argv)
char *p, *i;
ret = bb_getopt_ulflags(argc, argv, "p:i:", &p, &i);
if (ret & 1)
- patch_level = atoi(p);
+ patch_level = bb_xgetlarg(p, 10, -1, USHRT_MAX);
if (ret & 2) {
patch_file = bb_xfopen(i, "r");
} else {