|
From: <sv...@va...> - 2014-08-15 22:08:16
|
Author: florian
Date: Fri Aug 15 22:08:09 2014
New Revision: 14294
Log:
Remove VG_(strncpy_safely). It is no longer needed.
Modified:
branches/BUF_REMOVAL/coregrind/m_libcbase.c
branches/BUF_REMOVAL/include/pub_tool_libcbase.h
Modified: branches/BUF_REMOVAL/coregrind/m_libcbase.c
==============================================================================
--- branches/BUF_REMOVAL/coregrind/m_libcbase.c (original)
+++ branches/BUF_REMOVAL/coregrind/m_libcbase.c Fri Aug 15 22:08:09 2014
@@ -38,6 +38,8 @@
Assert machinery for use in this file. vg_assert cannot be called
here due to cyclic dependencies.
------------------------------------------------------------------ */
+#if 0 // currently unused
+
#define libcbase_assert(expr) \
((void) (LIKELY(expr) ? 0 : \
(ML_(libcbase_assert_fail)(#expr, \
@@ -57,6 +59,8 @@
VG_(exit_now)(1);
}
+#endif
+
/* ---------------------------------------------------------------------
HChar functions.
------------------------------------------------------------------ */
@@ -298,22 +302,6 @@
return dest_orig;
}
-/* Copy bytes, not overrunning the end of dest and always ensuring
- zero termination. */
-void VG_(strncpy_safely) ( HChar* dest, const HChar* src, SizeT ndest )
-{
- libcbase_assert(ndest > 0);
-
- SizeT i = 0;
- while (True) {
- dest[i] = 0;
- if (src[i] == 0) return;
- if (i >= ndest-1) return;
- dest[i] = src[i];
- i++;
- }
-}
-
HChar* VG_(strncpy) ( HChar* dest, const HChar* src, SizeT ndest )
{
SizeT i = 0;
Modified: branches/BUF_REMOVAL/include/pub_tool_libcbase.h
==============================================================================
--- branches/BUF_REMOVAL/include/pub_tool_libcbase.h (original)
+++ branches/BUF_REMOVAL/include/pub_tool_libcbase.h Fri Aug 15 22:08:09 2014
@@ -129,10 +129,6 @@
const HChar *input,
UInt *enum_set);
-/* Like strncpy(), but if 'src' is longer than 'ndest' inserts a '\0' as the
- last character. */
-extern void VG_(strncpy_safely) ( HChar* dest, const HChar* src, SizeT ndest );
-
/* ---------------------------------------------------------------------
mem* functions
------------------------------------------------------------------ */
|