# HG changeset patch # User Thibaut GIRKA # Date 1265472227 -3600 # Node ID 3b1593186f12d1ecefa88e90a96d2e214eee9cdc # Parent bdd8a5ff8f46ca12c50a451178349fb63f785484 fix pointers used to get strchr result diff --git a/scn2k/scn2k_cmd.cc b/scn2k/scn2k_cmd.cc --- 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[%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[%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; diff --git a/scn2k/scn2k_impl.cc b/scn2k/scn2k_impl.cc --- 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) {