Update of /cvsroot/perfparse/_perfparse/db_tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26547/db_tools
Modified Files:
convert.c
Log Message:
squashed some compiler warnings
Index: convert.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** convert.c 8 Aug 2007 22:19:17 -0000 1.39
--- convert.c 18 Dec 2007 00:03:00 -0000 1.40
***************
*** 83,92 ****
}
! void g_hash_table_insert_copy(GHashTable *hashCache,char *tmp_string,int tmp_int) {
// mallocs space for string and value (int) and inserts it into the table given
int *pInt=malloc(sizeof(int));
! char *pStr=malloc(sizeof(char)*(strlen(tmp_string)+1));
*pInt=tmp_int;
- strncpy(pStr,tmp_string,strlen(tmp_string)+1);
g_hash_table_insert(hashCache,(gpointer) pStr,pInt);
}
--- 83,91 ----
}
! void g_hash_table_insert_copy(GHashTable *hashCache,const char *tmp_string,int tmp_int) {
// mallocs space for string and value (int) and inserts it into the table given
int *pInt=malloc(sizeof(int));
! char *pStr=strdup(tmp_string);
*pInt=tmp_int;
g_hash_table_insert(hashCache,(gpointer) pStr,pInt);
}
|