aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2009-05-25 10:21:11 +0800
committerLiu Aleaxander <Aleaxander@gmail.com>2009-05-25 10:21:11 +0800
commitbc5ae77ff5ccf1cee85282d14e6675a509a04ef6 (patch)
tree14f37f79a837af1e78450b29657e429c99a18e6a
parent61f27976b3d268ca28f618c0814f6482737084bc (diff)
downloaddevel-bc5ae77ff5ccf1cee85282d14e6675a509a04ef6.tar.gz
devel-bc5ae77ff5ccf1cee85282d14e6675a509a04ef6.tar.xz
devel-bc5ae77ff5ccf1cee85282d14e6675a509a04ef6.zip
rmove all the malloc stuff
-rw-r--r--disklab.c2
-rw-r--r--extlinux.c1
-rw-r--r--ldlinux.c8
3 files changed, 4 insertions, 7 deletions
diff --git a/disklab.c b/disklab.c
index c9f1302..eebc5f4 100644
--- a/disklab.c
+++ b/disklab.c
@@ -10,7 +10,7 @@ void getlinsec(char *buf, int sector, int sector_cnt)
int bytes_read;
if ( lseek(fd, sector*512, SEEK_SET) < 0 ) {
- printf("seek file ext2.img error ....\n");
+ printf("seek file fs image error ....\n");
return;
}
diff --git a/extlinux.c b/extlinux.c
index f3f60bc..5b3be39 100644
--- a/extlinux.c
+++ b/extlinux.c
@@ -8,7 +8,6 @@
#include "types.h"
#include <stdio.h>
-#include <malloc.h>
#include <stdlib.h>
#include <string.h>
diff --git a/ldlinux.c b/ldlinux.c
index 12a3aad..9485da9 100644
--- a/ldlinux.c
+++ b/ldlinux.c
@@ -3,7 +3,6 @@
#include "disklab.h"
#include <stdio.h>
-#include <malloc.h>
#include <string.h>
@@ -501,7 +500,8 @@ __u32 first_sector(struct fat_dir_entry *dir)
}
-
+/* try with the biggest long name */
+char long_name[0x40 * 13];
/**
* search_dos_dir:
@@ -539,8 +539,7 @@ struct open_file_t* search_dos_dir(char *MangleBuf, __u32 dir_sector, \
int checksum;
int have_more;
- char *long_name;
-
+
file = allocate_file();
if ( !file )
return NULL;
@@ -550,7 +549,6 @@ struct open_file_t* search_dos_dir(char *MangleBuf, __u32 dir_sector, \
* "last" entry (which, of coures, comes first ...)
*/
slots = (NameLen + 12) / 13;
- long_name = (char *)malloc(13 * slots);
slots |= 0x40;
VFATInit = slots;