diff options
author | Darkvater <darkvater@openttd.org> | 2006-08-13 08:51:55 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2006-08-13 08:51:55 +0000 |
commit | 0daa7cdaed81f520e66690136352d890e7d7a623 (patch) | |
tree | 88168c8c1eb7220e7472e3adc1a01fc4bfa61e7b | |
parent | b1b0b26fc8a1fc499b1cbe4d3c51f71079bd34fe (diff) | |
download | openttd-0daa7cdaed81f520e66690136352d890e7d7a623.tar.xz |
(svn r5873) - Fix a bad comment in r5871, and add a further check for saving strings.
-rw-r--r-- | saveload.c | 3 | ||||
-rw-r--r-- | saveload.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/saveload.c b/saveload.c index d1e0cc7db..e4e653600 100644 --- a/saveload.c +++ b/saveload.c @@ -516,7 +516,8 @@ static void SlString(void *ptr, uint length, VarType conv) { uint len; assert(GetVarFileType(conv) == SLE_FILE_STRING); - assert(GetVarMemType(conv) == SLE_VAR_STRB || GetVarMemType(conv) == SLE_VAR_STRQ); + assert(GetVarMemType(conv) == SLE_VAR_STRB || GetVarMemType(conv) == SLE_VAR_STRBQ); + assert(ptr != NULL); if (_sl.save) { len = SlCalcNetStringLen(ptr, length); diff --git a/saveload.h b/saveload.h index 9b2ba8b4a..d8898a540 100644 --- a/saveload.h +++ b/saveload.h @@ -98,9 +98,9 @@ enum VarTypes { SLE_VAR_U64 = 8 << 4, SLE_VAR_NULL = 9 << 4, ///< useful to write zeros in savegame. SLE_VAR_STRB = 10 << 4, ///< normal string (with pre-allocated buffer) - SLE_VAR_STRBQ= 11 << 4, ///< string enclosed in parentheses (with pre-allocated buffer) + SLE_VAR_STRBQ= 11 << 4, ///< string enclosed in quotes (with pre-allocated buffer) SLE_VAR_STR = 12 << 4, ///< string pointer - SLE_VAR_STRQ = 13 << 4, ///< string enclosed in parentheses + SLE_VAR_STRQ = 13 << 4, ///< string enclosed in quotes /* 2 more possible memory-primitives */ /* Shortcut values */ |