diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-30 05:42:46 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-30 05:42:46 +0000 |
commit | 38a33addf7c6323bec68384041297395af1c2835 (patch) | |
tree | fa47f2c946413191267e815965c85f06142b0941 /util.c | |
parent | 71a903d4be8dddd03327a40eef435d539e26a429 (diff) | |
download | rtmux-38a33addf7c6323bec68384041297395af1c2835.tar.gz rtmux-38a33addf7c6323bec68384041297395af1c2835.tar.bz2 rtmux-38a33addf7c6323bec68384041297395af1c2835.zip |
Don't need cp.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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'; |