Use a union in fieldset->value

Instead of unreliably casting uint64_t's to (void *)
This commit is contained in:
Eric
2013-10-03 21:53:42 -04:00
parent a74f1d877b
commit ae07374bb9
3 changed files with 36 additions and 23 deletions

View File

@ -79,11 +79,11 @@ int csv_process(fieldset_t *fs)
fprintf(file, ", ");
}
if (f->type == FS_STRING) {
fprintf(file, "%s", (char*) f->value);
fprintf(file, "%s", (char*) f->value.ptr);
} else if (f->type == FS_UINT64) {
fprintf(file, "%lu", (uint64_t) f->value);
fprintf(file, "%llu", (uint64_t) f->value.num);
} else if (f->type == FS_BINARY) {
hex_encode(file, (unsigned char*) f->value, f->len);
hex_encode(file, (unsigned char*) f->value.ptr, f->len);
} else if (f->type == FS_NULL) {
// do nothing
} else {