comparison scn2k/scn2k_impl.cc @ 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 4416cfac86ae
comparison
equal deleted inserted replaced
61:bdd8a5ff8f46 62:3b1593186f12
1273 sscanf(save, "Scn=%d", &save_scn); 1273 sscanf(save, "Scn=%d", &save_scn);
1274 } else if (strncmp(save, "Point=", 6) == 0) { 1274 } else if (strncmp(save, "Point=", 6) == 0) {
1275 sscanf(save, "Point=%d", &save_point); 1275 sscanf(save, "Point=%d", &save_point);
1276 } else if (strncmp(save, "Title=", 6) == 0) { 1276 } else if (strncmp(save, "Title=", 6) == 0) {
1277 save += 6; 1277 save += 6;
1278 char* s = strchr(save, '\n'); 1278 const char* s = strchr(save, '\n');
1279 if (s == NULL) window_title = save; 1279 if (s == NULL) window_title = save;
1280 else window_title.assign(save, s-save); 1280 else window_title.assign(save, s-save);
1281 const char* config_name = config->GetParaStr("#CAPTION"); 1281 const char* config_name = config->GetParaStr("#CAPTION");
1282 if (config_name == NULL) config_name = ""; 1282 if (config_name == NULL) config_name = "";
1283 string setname = kconv(string(config_name)+" "+window_title); 1283 string setname = kconv(string(config_name)+" "+window_title);
1293 int scn, pt; 1293 int scn, pt;
1294 sscanf(save, "Stack=%d,%d", &scn, &pt); 1294 sscanf(save, "Stack=%d,%d", &scn, &pt);
1295 stack.push_back( StackItem(scn, pt)); 1295 stack.push_back( StackItem(scn, pt));
1296 } else if (strncmp(save, "StackStr=", 9) == 0) { 1296 } else if (strncmp(save, "StackStr=", 9) == 0) {
1297 save += 9; 1297 save += 9;
1298 char* s = strchr(save, '\n'); 1298 const char* s = strchr(save, '\n');
1299 if (s == NULL) stack_strbuffer.push_back(""); 1299 if (s == NULL) stack_strbuffer.push_back("");
1300 else stack_strbuffer.push_back(string(save, s-save)); 1300 else stack_strbuffer.push_back(string(save, s-save));
1301 } else if (strncmp(save, "Cmd=", 4) == 0) { 1301 } else if (strncmp(save, "Cmd=", 4) == 0) {
1302 CmdSimplified cmd; 1302 CmdSimplified cmd;
1303 cmd.Load(save+4, cmd_stack_str); 1303 cmd.Load(save+4, cmd_stack_str);