diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-08 21:47:06 -0700 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-05-08 21:47:06 -0700 |
commit | 66240b78d9ee8d4bbdfb3a5ccf9d87058cddf0de (patch) | |
tree | 6a6e028ba4d7dbc8b24ce88ca59ac02fc6ab74b0 | |
parent | 433f43ec71447c447cdc6142ab5829a8eea258a7 (diff) |
Make error handlint more robust in Format_Len_Unicode
xprop.c:1011:2: warning: Function call argument is an uninitialized value
memcpy(_formatting_buffer, error, strlen(error)+1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xprop.c:1011:36: note: instantiated from:
memcpy(_formatting_buffer, error, strlen(error)+1);
^ ~~~~~
Found-by: clang static analysis
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r-- | xprop.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -999,6 +999,8 @@ Format_Len_Unicode (const char *string, int len) error = "<Invalid UTF-8 string: Tail too short> "; break; case UTF8_LONG_TAIL: error = "<Invalid UTF-8 string: Tail too long> "; break; + default: + error = "<Invalid UTF-8 string: Unknown error>"; break; } result = Format_Len_String(string, len); |