+2013-10-26 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/fs/iso9660.c: Replace strncat with memcpy.
+ * include/grub/misc.h: Remove strncat.
+ * grub-core/lib/posix_wrap/string.h: Likewise.
+
2013-10-26 Vladimir Serbinenko <phcoder@gmail.com>
* tests/date_unit_test.c: New test.
if (! ctx->symlink)
return;
- ctx->symlink[size] = 0;
- grub_strncat (ctx->symlink, part, len2);
+ grub_memcpy (ctx->symlink + size, part, len2);
+ ctx->symlink[size + len2] = 0;
}
static grub_err_t
ctx->filename = (char *) "..";
else if (entry->len >= 5)
{
- grub_size_t size = 1, csize = 1;
+ grub_size_t off = 0, csize = 1;
char *old;
- csize = size = entry->len - 5;
+ csize = entry->len - 5;
old = ctx->filename;
if (ctx->filename_alloc)
{
- size += grub_strlen (ctx->filename);
- ctx->filename = grub_realloc (ctx->filename, size + 1);
+ off = grub_strlen (ctx->filename);
+ ctx->filename = grub_realloc (ctx->filename, csize + off + 1);
}
else
{
- ctx->filename_alloc = 1;
- ctx->filename = grub_zalloc (size + 1);
- ctx->filename[0] = 0;
+ off = 0;
+ ctx->filename = grub_zalloc (csize + 1);
}
if (!ctx->filename)
{
return grub_errno;
}
ctx->filename_alloc = 1;
- grub_strncat (ctx->filename, (char *) &entry->data[1], csize);
- ctx->filename[size] = '\0';
+ grub_memcpy (ctx->filename + off, (char *) &entry->data[1], csize);
+ ctx->filename[off + csize] = '\0';
}
}
/* The mode information (st_mode). */
return grub_strcat (dest, src);
}
-static inline char *
-strncat (char *dest, const char *src, grub_size_t n)
-{
- return grub_strncat (dest, src, n);
-}
-
static inline int
strcoll (const char *s1, const char *s2)
{