mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-28 10:10:29 +00:00
* grub-core/fs/ext2.c (grub_ext2_read_symlink): Use memcpy rather
strncpy. * grub-core/fs/jfs.c (grub_jfs_lookup_symlink): Likewise. * grub-core/kern/misc.c (grub_strncpy): Move from here ... * include/grub/misc.h (grub_strncpy): ... to here. Make inline. * grub-core/net/net.c (grub_net_addr_to_str): Use COMPILE_TIME_ASSERT + strcpy rather than strncpy.
This commit is contained in:
1 parent
8fbe5c7df7
commit
eb03ede014
6 files changed
+29
-19
No files matched your search
+12
-1
@@ -66,7 +66,18 @@
|
||||
|
||||
void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n);
|
||||
char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src);
|
||||
char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c);
|
||||
|
||||
static inline char *
|
||||
grub_strncpy (char *dest, const char *src, int c)
|
||||
{
|
||||
char *p = dest;
|
||||
|
||||
while ((*p++ = *src++) != '\0' && --c)
|
||||
;
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
static inline char *
|
||||
grub_stpcpy (char *dest, const char *src)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user