summaryrefslogtreecommitdiffstats
path: root/text-utils/parse.c
diff options
context:
space:
mode:
authorOndrej Oprala2013-09-23 15:39:16 +0200
committerKarel Zak2013-11-08 12:54:52 +0100
commit9c2cb9b0ea6b26e617a293f6dba2ff54bd7c047b (patch)
treeabecc66b48f09f2ac78bc020bd994e3540cabe54 /text-utils/parse.c
parenthexdump: rewrite rewrite() (diff)
downloadkernel-qcow2-util-linux-9c2cb9b0ea6b26e617a293f6dba2ff54bd7c047b.tar.gz
kernel-qcow2-util-linux-9c2cb9b0ea6b26e617a293f6dba2ff54bd7c047b.tar.xz
kernel-qcow2-util-linux-9c2cb9b0ea6b26e617a293f6dba2ff54bd7c047b.zip
hexdump: rewrite escape()
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Diffstat (limited to 'text-utils/parse.c')
-rw-r--r--text-utils/parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/text-utils/parse.c b/text-utils/parse.c
index 657f15727..90c600375 100644
--- a/text-utils/parse.c
+++ b/text-utils/parse.c
@@ -471,7 +471,8 @@ static void escape(char *p1)
char *p2;
/* alphabetic escape sequences have to be done in place */
- for (p2 = p1;; ++p1, ++p2) {
+ p2 = p1;
+ while (TRUE) {
if (!*p1) {
*p2 = *p1;
break;
@@ -504,6 +505,7 @@ static void escape(char *p1)
*p2 = *p1;
break;
}
+ ++p1; ++p2;
}
}