From: David Given Date: Thu, 27 Oct 2016 19:48:46 +0000 (+0200) Subject: Allow emission of strings containing ". X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=be3dece5af1ec2bb063298226aeffef1add88a02;p=ack.git Allow emission of strings containing ". --- diff --git a/mach/proto/mcg/data.c b/mach/proto/mcg/data.c index 38525b724..6b6fc084f 100644 --- a/mach/proto/mcg/data.c +++ b/mach/proto/mcg/data.c @@ -74,6 +74,11 @@ void data_float(const char* data, size_t size, bool is_ro) fprintf(outputfile, "\n"); } +static bool istext(c) +{ + return isprint(c) && (c != '"'); +} + void data_block(const uint8_t* data, size_t size, bool is_ro) { const uint8_t* start = data; @@ -85,7 +90,7 @@ void data_block(const uint8_t* data, size_t size, bool is_ro) start = p = data; while (p < end) { - while ((p < end) && isprint(*p)) + while ((p < end) && istext(*p)) p++; if (start < p) @@ -99,7 +104,7 @@ void data_block(const uint8_t* data, size_t size, bool is_ro) fprintf(outputfile, "\"\n"); } - while ((p < end) && !isprint(*p)) + while ((p < end) && !istext(*p)) p++; if (start < p)