resolve a static analyzer complaint in glyphs.c
src/glyphs.c(680): warning: Dereferencing NULL pointer.
'other' contains the same NULL value as 'obj_glyphs[idx].u' did.
This commit is contained in:
14
src/glyphs.c
14
src/glyphs.c
@@ -675,12 +675,14 @@ shuffle_customizations(void)
|
||||
tmp_customcolor[i] = other_customcolor;
|
||||
tmp_color256idx[i] = other_color256idx;
|
||||
#ifdef ENHANCED_SYMBOLS
|
||||
tmp_u[i] = (struct unicode_representation *)
|
||||
alloc(sizeof *tmp_u[i]);
|
||||
*tmp_u[i] = *other;
|
||||
if (other->utf8str != NULL) {
|
||||
tmp_u[i]->utf8str = (uint8 *)
|
||||
dupstr((const char *) other->utf8str);
|
||||
if (other) {
|
||||
tmp_u[i] = (struct unicode_representation *) alloc(
|
||||
sizeof *tmp_u[i]);
|
||||
*tmp_u[i] = *other;
|
||||
if (other->utf8str != NULL) {
|
||||
tmp_u[i]->utf8str =
|
||||
(uint8 *) dupstr((const char *) other->utf8str);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user