Mercurial > cgi-bin > hgwebdir.cgi > VMS > C_Libraries > Hash_impl
changeset 8:bac20745c52e VMS__malloc_brch
Nov 14 Vers -- fixed strcpy to VMS__strDup
| author | Me |
|---|---|
| date | Sun, 14 Nov 2010 11:13:24 -0800 |
| parents | e072db5aa783 |
| children | ce35f7028eba |
| files | PrivateHash.c |
| diffstat | 1 files changed, 1 insertions(+), 3 deletions(-) [+] |
line diff
1.1 --- a/PrivateHash.c Tue Nov 02 16:45:50 2010 -0700 1.2 +++ b/PrivateHash.c Sun Nov 14 11:13:24 2010 -0800 1.3 @@ -114,9 +114,7 @@ 1.4 { hashIdx = hashThisKey( key, table->tableSz ); 1.5 hashEntry = (HashEntry*) VMS__malloc( sizeof( HashEntry ) ); 1.6 if( hashEntry == NULL ) return 0; 1.7 - hashEntry->key = VMS__malloc( strlen(key) ); 1.8 - if( hashEntry->key == NULL ) return 0; 1.9 - strcpy( hashEntry->key, key ); 1.10 + hashEntry->key = VMS__strDup( key ); 1.11 hashEntry->next = (table->entries)[hashIdx]; 1.12 (table->entries)[hashIdx] = hashEntry; 1.13 table->numEntries += 1;
