diff options
author | rsesek@chromium.org <rsesek@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-04-19 19:32:20 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-04-19 19:32:20 +0000 |
commit | 093b8aee9b11ffc1f397ffd296ad4dbb5f9a0540 (patch) | |
tree | 89493cae6290f9c45aa416577defb067ddc0f9d1 | |
parent | Move SimpleStringDictionary from common/mac/ to just common/. (diff) | |
download | breakpad-093b8aee9b11ffc1f397ffd296ad4dbb5f9a0540.tar.xz |
Get SimpleStringDictionary compiling on Linux.
BUG=http://code.google.com/p/chromium/issues/detail?id=77656
Review URL: https://breakpad.appspot.com/564002
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1155 4c0a9323-5329-0410-9bdc-e9ce6186880e
-rw-r--r-- | src/common/simple_string_dictionary.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/simple_string_dictionary.h b/src/common/simple_string_dictionary.h index dbeaabc0..26bcba57 100644 --- a/src/common/simple_string_dictionary.h +++ b/src/common/simple_string_dictionary.h @@ -30,8 +30,7 @@ #ifndef COMMON_SIMPLE_STRING_DICTIONARY_H_ #define COMMON_SIMPLE_STRING_DICTIONARY_H_ -#import <string> -#import <vector> +#include <string.h> namespace google_breakpad { @@ -80,15 +79,18 @@ class KeyValueEntry { value = ""; } - strlcpy(key_, key, sizeof(key_)); - strlcpy(value_, value, sizeof(value_)); + strncpy(key_, key, sizeof(key_)); + strncpy(value_, value, sizeof(value_)); + key_[sizeof(key_) - 1] = '\0'; + value_[sizeof(value_) - 1] = '\0'; } void SetValue(const char *value) { if (!value) { value = ""; } - strlcpy(value_, value, sizeof(value_)); + strncpy(value_, value, sizeof(value_)); + value_[sizeof(value_) - 1] = '\0'; }; // Removes the key/value |