aboutsummaryrefslogtreecommitdiff
path: root/editors/patch.c
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-10-27 06:59:05 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-10-27 06:59:05 +0000
commitd73fbca0b60e039c23e21ce09231603eb21c8d7c (patch)
tree7d95bac975d02194beba3ecde62fb126617746aa /editors/patch.c
parent63bee47351f99211203e758365210191a801a26c (diff)
downloadbusybox-w32-d73fbca0b60e039c23e21ce09231603eb21c8d7c.tar.gz
busybox-w32-d73fbca0b60e039c23e21ce09231603eb21c8d7c.tar.bz2
busybox-w32-d73fbca0b60e039c23e21ce09231603eb21c8d7c.zip
- correct boilerplate
- use bb_xgetlarg for the patch_level to catch invalid arguments. git-svn-id: svn://busybox.net/trunk/busybox@11927 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'editors/patch.c')
-rw-r--r--editors/patch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/patch.c b/editors/patch.c
index f28395397..bcd3c6830 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -3,7 +3,7 @@
3 * busybox patch applet to handle the unified diff format. 3 * busybox patch applet to handle the unified diff format.
4 * Copyright (C) 2003 Glenn McGrath <bug1@iinet.net.au> 4 * Copyright (C) 2003 Glenn McGrath <bug1@iinet.net.au>
5 * 5 *
6 * Licensed under the GPL v2, see the file LICENSE in this tarball. 6 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
7 * 7 *
8 * This applet is written to work with patches generated by GNU diff, 8 * This applet is written to work with patches generated by GNU diff,
9 * where there is equivalent functionality busybox patch shall behave 9 * where there is equivalent functionality busybox patch shall behave
@@ -99,7 +99,7 @@ extern int patch_main(int argc, char **argv)
99 char *p, *i; 99 char *p, *i;
100 ret = bb_getopt_ulflags(argc, argv, "p:i:", &p, &i); 100 ret = bb_getopt_ulflags(argc, argv, "p:i:", &p, &i);
101 if (ret & 1) 101 if (ret & 1)
102 patch_level = atoi(p); 102 patch_level = bb_xgetlarg(p, 10, -1, USHRT_MAX);
103 if (ret & 2) { 103 if (ret & 2) {
104 patch_file = bb_xfopen(i, "r"); 104 patch_file = bb_xfopen(i, "r");
105 } else { 105 } else {