Mercurial > otakunoraifu
changeset 62:3b1593186f12
fix pointers used to get strchr result
author | Thibaut GIRKA <thib@sitedethib.com> |
---|---|
date | Sat, 06 Feb 2010 17:03:47 +0100 |
parents | bdd8a5ff8f46 |
children | 4b9ffe15a87d |
files | scn2k/scn2k_cmd.cc scn2k/scn2k_impl.cc |
diffstat | 2 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scn2k/scn2k_cmd.cc +++ b/scn2k/scn2k_cmd.cc @@ -266,9 +266,9 @@ void Flags::Load(const char* save) { char buf[1024]; int n; if (sscanf(save, "V<C>[%04d]=",&n) == 1) { - char* s = strchr(save, '='); + const char* s = strchr(save, '='); s++; - char* send = strchr(s, '\n'); + const char* send = strchr(s, '\n'); int slen = send - s; strncpy(buf, s, slen); buf[slen] = 0; @@ -335,9 +335,9 @@ void Flags::LoadSys(const char* save) { char buf[1024]; int n; if (sscanf(save, "V<M>[%04d]=",&n) == 1) { - char* s = strchr(save, '='); + const char* s = strchr(save, '='); s++; - char* send = strchr(s, '\n'); + const char* send = strchr(s, '\n'); int slen = send - s; strncpy(buf, s, slen); buf[slen] = 0;
--- a/scn2k/scn2k_impl.cc +++ b/scn2k/scn2k_impl.cc @@ -1275,7 +1275,7 @@ void Scn2k::LoadImpl(const char* save) { sscanf(save, "Point=%d", &save_point); } else if (strncmp(save, "Title=", 6) == 0) { save += 6; - char* s = strchr(save, '\n'); + const char* s = strchr(save, '\n'); if (s == NULL) window_title = save; else window_title.assign(save, s-save); const char* config_name = config->GetParaStr("#CAPTION"); @@ -1295,7 +1295,7 @@ void Scn2k::LoadImpl(const char* save) { stack.push_back( StackItem(scn, pt)); } else if (strncmp(save, "StackStr=", 9) == 0) { save += 9; - char* s = strchr(save, '\n'); + const char* s = strchr(save, '\n'); if (s == NULL) stack_strbuffer.push_back(""); else stack_strbuffer.push_back(string(save, s-save)); } else if (strncmp(save, "Cmd=", 4) == 0) {