]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix issue with decoding ^-escaped characters in realtime.
authorJason Parker <jparker@digium.com>
Fri, 27 Aug 2010 20:29:11 +0000 (20:29 +0000)
committerJason Parker <jparker@digium.com>
Fri, 27 Aug 2010 20:29:11 +0000 (20:29 +0000)
(closes issue #17790)
Reported by: denzs
Patches:
      17790-chunky.diff uploaded by qwell (license 4)
Tested by: qwell, denzs

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@283880 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_config_odbc.c
res/res_config_pgsql.c

index b735c0cd932c20bd5f795701b80e73571253b912..daed738d2fc93bb0b6303703caf6ca82a8d30394 100644 (file)
@@ -68,7 +68,7 @@ static void decode_chunk(char *chunk)
 {
        for (; *chunk; chunk++) {
                if (*chunk == '^' && strchr("0123456789ABCDEFabcdef", chunk[1]) && strchr("0123456789ABCDEFabcdef", chunk[2])) {
-                       sscanf(chunk + 1, "%02hhd", chunk);
+                       sscanf(chunk + 1, "%02hhX", chunk);
                        memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
                }
        }
index f6cd7250be136a64339d6d5c6990bdf6a17a7e14..beed9e2dd58ec0ddaeda3086ffe7326d368871b7 100644 (file)
@@ -100,7 +100,7 @@ static char *decode_chunk(char *chunk)
        char *orig = chunk;
        for (; *chunk; chunk++) {
                if (*chunk == '^' && strchr("0123456789ABCDEFabcdef", chunk[1]) && strchr("0123456789ABCDEFabcdef", chunk[2])) {
-                       sscanf(chunk + 1, "%02hhd", chunk);
+                       sscanf(chunk + 1, "%02hhX", chunk);
                        memmove(chunk + 1, chunk + 3, strlen(chunk + 3) + 1);
                }
        }