aboutsummaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-04-30 05:42:46 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-04-30 05:42:46 +0000
commit38a33addf7c6323bec68384041297395af1c2835 (patch)
treefa47f2c946413191267e815965c85f06142b0941 /util.c
parent71a903d4be8dddd03327a40eef435d539e26a429 (diff)
downloadrtmux-38a33addf7c6323bec68384041297395af1c2835.tar.gz
rtmux-38a33addf7c6323bec68384041297395af1c2835.tar.bz2
rtmux-38a33addf7c6323bec68384041297395af1c2835.zip
Don't need cp.
Diffstat (limited to 'util.c')
-rw-r--r--util.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/util.c b/util.c
index 6a7190d2..f5658668 100644
--- a/util.c
+++ b/util.c
@@ -1,4 +1,4 @@
-/* $Id: util.c,v 1.2 2009-04-29 22:25:20 nicm Exp $ */
+/* $Id: util.c,v 1.3 2009-04-30 05:42:46 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -55,17 +55,16 @@ section_string(char *buf, size_t len, size_t sectoff, size_t sectlen)
void
clean_string(const char *in, char *buf, size_t len)
{
- const u_char *cp;
- size_t off;
+ size_t off;
off = 0;
- for (cp = in; *cp != '\0'; cp++) {
+ for (; *in != '\0'; in++) {
if (off >= len)
break;
- if (*cp >= 0x20 && *cp <= 0x7f)
- buf[off++] = *cp;
+ if (*in >= 0x20 && *in <= 0x7f)
+ buf[off++] = *in;
else
- off += xsnprintf(buf + off, len - off, "\\%03hho", *cp);
+ off += xsnprintf(buf + off, len - off, "\\%03hho", *in);
}
if (off < len)
buf[off] = '\0';