2010-02-07 Vladimir Serbinenko <phcoder@gmail.com>
Fix warnings in grub-emu when compiling with maximum warning options. * util/grub-emu.c (ENABLE_RELOCATABLE): New definition. (grub_arch_modules_addr): Return 0 and not NULL. * util/misc.c (ENABLE_RELOCATABLE): New definition. (xstrdup): USe newstr instead of dup.
This commit is contained in:
parent
74e31b5ca2
commit
98e6959dea
3 changed files with 16 additions and 5 deletions
|
@ -43,6 +43,7 @@
|
|||
#include <grub/time.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#define ENABLE_RELOCATABLE 0
|
||||
#include "progname.h"
|
||||
|
||||
/* Include malloc.h, only if memalign is available. It is known that
|
||||
|
@ -142,13 +143,13 @@ char *
|
|||
xstrdup (const char *str)
|
||||
{
|
||||
size_t len;
|
||||
char *dup;
|
||||
char *newstr;
|
||||
|
||||
len = strlen (str);
|
||||
dup = (char *) xmalloc (len + 1);
|
||||
memcpy (dup, str, len + 1);
|
||||
newstr = (char *) xmalloc (len + 1);
|
||||
memcpy (newstr, str, len + 1);
|
||||
|
||||
return dup;
|
||||
return newstr;
|
||||
}
|
||||
|
||||
char *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue