ncacn_http: fix GNUism
authorRalph Boehme <slow@samba.org>
Thu, 9 Oct 2014 14:41:10 +0000 (16:41 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 9 Oct 2014 20:05:25 +0000 (22:05 +0200)
%a format conversion is a GNU extension, use the more portable %m.
It's at least in SUSv4, supported by glibc since 2.7 and FreeBSD 10.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Oct  9 22:05:26 CEST 2014 on sn-devel-104

source4/lib/http/http.c

index 314ceed19bc0bcca082422dd4b69830bb1e5078b..c3bd728a79b4c847ed256c805b18cc21e444b572 100644 (file)
@@ -112,7 +112,7 @@ static enum http_read_status http_parse_headers(struct http_read_response_state
                return HTTP_ALL_DATA_READ;
        }
 
-       n = sscanf(line, "%a[^:]: %a[^\r\n]\r\n", &key, &value);
+       n = sscanf(line, "%m[^:]: %m[^\r\n]\r\n", &key, &value);
        if (n != 2) {
                DEBUG(0, ("%s: Error parsing header '%s'\n", __func__, line));
                status = HTTP_DATA_CORRUPTED;
@@ -158,7 +158,7 @@ static bool http_parse_response_line(struct http_read_response_state *state)
                return false;
        }
 
-       n = sscanf(line, "%a[^/]/%c.%c %d %a[^\r\n]\r\n",
+       n = sscanf(line, "%m[^/]/%c.%c %d %m[^\r\n]\r\n",
                   &protocol, &major, &minor, &code, &msg);
 
        DEBUG(11, ("%s: Header parsed(%i): protocol->%s, major->%c, minor->%c, "