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:
Vladimir 'phcoder' Serbinenko 2010-02-07 02:37:48 +01:00
parent 74e31b5ca2
commit 98e6959dea
3 changed files with 16 additions and 5 deletions

View file

@ -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 *