summaryrefslogtreecommitdiff
path: root/xprop.c
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-08 21:47:06 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-05-08 21:47:06 -0700
commit66240b78d9ee8d4bbdfb3a5ccf9d87058cddf0de (patch)
tree6a6e028ba4d7dbc8b24ce88ca59ac02fc6ab74b0 /xprop.c
parent433f43ec71447c447cdc6142ab5829a8eea258a7 (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>
Diffstat (limited to 'xprop.c')
-rw-r--r--xprop.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xprop.c b/xprop.c
index b870d97..4c4c702 100644
--- a/xprop.c
+++ b/xprop.c
@@ -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);