Changeset 58
- Timestamp:
- 10/01/05 20:51:46 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/reglookup.c
r56 r58 171 171 172 172 case REG_DWORD: 173 ascii_max = sizeof(char)*1 0;174 ascii = malloc(ascii_max +1);173 ascii_max = sizeof(char)*11; 174 ascii = malloc(ascii_max); 175 175 if(ascii == NULL) 176 176 return NULL; 177 177 178 if (*(int *)datap == 0) 179 snprintf((char*)ascii, ascii_max, "0"); 180 else 181 snprintf((char*)ascii, ascii_max, "0x%x", *(int *)datap); 178 snprintf((char*)ascii, ascii_max, "0x%.2X%.2X%.2X%.2X", 179 datap[0], datap[1], datap[2], datap[3]); 180 return ascii; 181 break; 182 183 case REG_DWORD_BE: 184 ascii_max = sizeof(char)*11; 185 ascii = malloc(ascii_max); 186 if(ascii == NULL) 187 return NULL; 188 189 snprintf((char*)ascii, ascii_max, "0x%.2X%.2X%.2X%.2X", 190 datap[3], datap[2], datap[1], datap[0]); 182 191 return ascii; 183 192 break;
Note: See TracChangeset
for help on using the changeset viewer.