diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-01-24 23:01:37 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-01-24 23:01:37 +0000 |
commit | 2df21cb1b7afdc36eb58a42c429f743d16d81a6e (patch) | |
tree | 4ee6de345288ff1cd3b9fec71b014bb0106f87f9 /conditions.c | |
parent | c2f444f65691cbc3f5dd93d4f898c3bfff6f9f2b (diff) | |
download | wireshark-2df21cb1b7afdc36eb58a42c429f743d16d81a6e.tar.gz wireshark-2df21cb1b7afdc36eb58a42c429f743d16d81a6e.tar.bz2 wireshark-2df21cb1b7afdc36eb58a42c429f743d16d81a6e.zip |
Fixed some strcpy -> strncpy/g_snprintf cleanups.
Removed a debug printout in t38.
svn path=/trunk/; revision=24188
Diffstat (limited to 'conditions.c')
-rw-r--r-- | conditions.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/conditions.c b/conditions.c index b6276e7ca2..95b42f7bea 100644 --- a/conditions.c +++ b/conditions.c @@ -70,7 +70,8 @@ condition* cnd_new(const char* class_id, ...){ g_free(cnd_ref); return NULL; } - strcpy(id, class_id); + strncpy(id, class_id, strlen(class_id)); + id[strlen(class_id)] = '\0'; cnd_ref->class_id = id; /* perform class specific initialization */ va_start(ap, class_id); @@ -146,7 +147,8 @@ 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; - strcpy(key, class_id); + strncpy(key, class_id, strlen(class_id)); + key[strlen(class_id)] = '\0'; /* initialize class structure */ if((cls = (_cnd_class*)g_malloc(sizeof(_cnd_class))) == NULL){ g_free(key); |