From 03fb47d7ba5f56429817ea5ac6ed890fbab2aa4e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 26 Sep 2013 17:45:30 +0900 Subject: [PATCH] Fix some sizeof goofs. Yay for continually improving gcc warnings :) --- qw/source/cl_chat.c | 2 +- tools/qfcc/source/type.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qw/source/cl_chat.c b/qw/source/cl_chat.c index 305c14f55..2b40e64dd 100644 --- a/qw/source/cl_chat.c +++ b/qw/source/cl_chat.c @@ -160,7 +160,7 @@ static qboolean cam_iterator (ignore_t *ig, llist_node_t *node) return true; } dsprintf (g_cam_test, "%s: ", Info_ValueForKey (cl.players[ig->slot].userinfo, "name")); - if (!strncmp (g_cam_test->str, g_cam_str, sizeof (g_cam_test->str))) { + if (!strncmp (g_cam_test->str, g_cam_str, g_cam_test->size - 1)) { return g_cam_allowed = false; } else return true; diff --git a/tools/qfcc/source/type.c b/tools/qfcc/source/type.c index 0077d36c7..92d63b11f 100644 --- a/tools/qfcc/source/type.c +++ b/tools/qfcc/source/type.c @@ -182,7 +182,7 @@ free_type (type_t *type) free_type (type->t.array.type); break; } - memset (type, 0, sizeof (type)); + memset (type, 0, sizeof (*type)); FREE (types, type); }