From e929dc55bdde2d80c517270349faa1cae97e03d8 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Sun, 5 Feb 2006 19:16:16 +0000 Subject: [PATCH] synced CString.h --- dlls/engine/CString.h | 8 +++++--- dlls/nvault/CString.h | 8 +++++--- dlls/sqlite/CString.h | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/dlls/engine/CString.h b/dlls/engine/CString.h index 4fe52b15..14b86509 100755 --- a/dlls/engine/CString.h +++ b/dlls/engine/CString.h @@ -107,8 +107,10 @@ public: { clear(); } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); + size_t len = strlen(d); + Grow(len + 1, false); + memcpy(v, d, len); + v[len] = '\0'; } } @@ -118,7 +120,7 @@ public: v[0] = '\0'; } - int compare (const char *d) + int compare (const char *d) const { if (!v) return strcmp("", d); diff --git a/dlls/nvault/CString.h b/dlls/nvault/CString.h index 4fe52b15..14b86509 100755 --- a/dlls/nvault/CString.h +++ b/dlls/nvault/CString.h @@ -107,8 +107,10 @@ public: { clear(); } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); + size_t len = strlen(d); + Grow(len + 1, false); + memcpy(v, d, len); + v[len] = '\0'; } } @@ -118,7 +120,7 @@ public: v[0] = '\0'; } - int compare (const char *d) + int compare (const char *d) const { if (!v) return strcmp("", d); diff --git a/dlls/sqlite/CString.h b/dlls/sqlite/CString.h index 4fe52b15..14b86509 100755 --- a/dlls/sqlite/CString.h +++ b/dlls/sqlite/CString.h @@ -107,8 +107,10 @@ public: { clear(); } else { - Grow(strlen(d) + 1, false); - strcpy(v, d); + size_t len = strlen(d); + Grow(len + 1, false); + memcpy(v, d, len); + v[len] = '\0'; } } @@ -118,7 +120,7 @@ public: v[0] = '\0'; } - int compare (const char *d) + int compare (const char *d) const { if (!v) return strcmp("", d);