comparison lwlink/objdump.c @ 8:fdc11ef4115b

Switched lwlink to lw_cmdline from argp and also brought in lw_alloc and lw_string to replace util.c
author lost@l-w.ca
date Sat, 22 Jan 2011 09:58:24 -0700
parents 7317fbe024af
children fc8386b13399
comparison
equal deleted inserted replaced
7:917b608b8c66 8:fdc11ef4115b
23 */ 23 */
24 #include <stdio.h> 24 #include <stdio.h>
25 #include <stdlib.h> 25 #include <stdlib.h>
26 #include <string.h> 26 #include <string.h>
27 27
28 #include "util.h" 28 #include <lw_alloc.h>
29 29
30 #ifdef HAVE_CONFIG_H 30 #ifdef HAVE_CONFIG_H
31 #include "config.h" 31 #include "config.h"
32 #endif 32 #endif
33 33
98 } 98 }
99 fseek(f, 0, SEEK_END); 99 fseek(f, 0, SEEK_END);
100 size = ftell(f); 100 size = ftell(f);
101 rewind(f); 101 rewind(f);
102 102
103 filedata = lw_malloc(size); 103 filedata = lw_alloc(size);
104 104
105 bread = fread(filedata, 1, size, f); 105 bread = fread(filedata, 1, size, f);
106 if (bread < size) 106 if (bread < size)
107 { 107 {
108 fprintf(stderr, "Short read on file %s (%ld/%ld):", argv[1], bread, size); 108 fprintf(stderr, "Short read on file %s (%ld/%ld):", argv[1], bread, size);