aboutsummaryrefslogtreecommitdiffstats
path: root/conditions.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2008-05-13 06:55:45 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2008-05-13 06:55:45 +0000
commit4fae53e13bdc32d7fd76ea6dd589ffc707f47ffc (patch)
tree12995894e0aecdc1b77d82b99e7b1af32041ead0 /conditions.c
parent97fea359656b5f889fe5d3e0a0e086daa9eaca83 (diff)
Fix some of the Errors/warnings detected by checkapi.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25283 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'conditions.c')
-rw-r--r--conditions.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/conditions.c b/conditions.c
index 95b42f7bea..33d20fe229 100644
--- a/conditions.c
+++ b/conditions.c
@@ -70,8 +70,7 @@ condition* cnd_new(const char* class_id, ...){
g_free(cnd_ref);
return NULL;
}
- strncpy(id, class_id, strlen(class_id));
- id[strlen(class_id)] = '\0';
+ g_strlcpy(id, class_id, strlen(class_id));
cnd_ref->class_id = id;
/* perform class specific initialization */
va_start(ap, class_id);
@@ -147,8 +146,7 @@ gboolean cnd_register_class(const char* class_id,
/* GHashTable keys need to be persistent for the lifetime of the hash
table. Allocate memory and copy the class id which we use as key. */
if((key = (char*)g_malloc(strlen(class_id)+1)) == NULL) return FALSE;
- strncpy(key, class_id, strlen(class_id));
- key[strlen(class_id)] = '\0';
+ g_strlcpy(key, class_id, strlen(class_id));
/* initialize class structure */
if((cls = (_cnd_class*)g_malloc(sizeof(_cnd_class))) == NULL){
g_free(key);