sfeed_jsonfeed: don't check control-characters - randomcrap - random crap programs of varying quality
HTML git clone git://git.codemadness.org/randomcrap
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit c25c282d817b2fde16f5dedb4c6112f9c5771164
DIR parent 24f66cebd6695e6e4a43a9599f9f7a2cd89917c4
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Wed, 8 Mar 2023 22:25:40 +0100
sfeed_jsonfeed: don't check control-characters
Use the same pattern as other format tools. At this point don't even worry
about incorrect sfeed(5) data with control-characters (like \r or whatever).
Diffstat:
M sfeed/sfeed_jsonfeed.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
---
DIR diff --git a/sfeed/sfeed_jsonfeed.c b/sfeed/sfeed_jsonfeed.c
@@ -25,10 +25,7 @@ printcontent(const char *s)
break; /* ignore invalid escape sequence */
case '"': fputs("\\\"", stdout); break;
default:
- if (ISCNTRL((unsigned char)*s))
- ; /* there are no control-chars in sfeed(5) data */
- else
- putchar(*s);
+ putchar(*s);
break;
}
}
@@ -38,9 +35,7 @@ static void
printfield(const char *s)
{
for (; *s; s++) {
- if (ISCNTRL((unsigned char)*s))
- ; /* there are no control-chars in sfeed(5) data */
- else if (*s == '\\')
+ if (*s == '\\')
fputs("\\\\", stdout);
else if (*s == '"')
fputs("\\\"", stdout);