From: Ben Pfaff Date: Tue, 5 Nov 2013 06:37:23 +0000 (-0800) Subject: ofpbuf: Allow whitespace other than spaces in hex data. X-Git-Tag: sliver-openvswitch-2.0.90-1~5^2~61 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=1a8def8ecad3379ed1da34214a193f6e883cecf7;p=sliver-openvswitch.git ofpbuf: Allow whitespace other than spaces in hex data. It's easier to cut and paste lines of hexadecimal data into a command line if you don't have to worry about new-lines appearing in the command. Signed-off-by: Ben Pfaff Acked-by: Jarno Rajahalme --- diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c index f7145dbfe..d578ab56a 100644 --- a/lib/ofpbuf.c +++ b/lib/ofpbuf.c @@ -407,7 +407,7 @@ ofpbuf_put_hex(struct ofpbuf *b, const char *s, size_t *n) uint8_t byte; bool ok; - s += strspn(s, " "); + s += strspn(s, " \t\r\n"); byte = hexits_value(s, 2, &ok); if (!ok) { if (n) {