ide/debugger: Fixed crash on watch string too long
authorJerome St-Louis <jerome@ecere.com>
Tue, 16 Apr 2013 07:03:02 +0000 (03:03 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 16 Apr 2013 07:03:02 +0000 (03:03 -0400)
- Also fixed dialog parent, warning

ide/src/debugger/process.ec
ide/src/designer/CodeEditor.ec
ide/src/panels/WatchesView.ec

index 01e9097..10f6522 100644 (file)
@@ -339,7 +339,7 @@ int Process_GetChildExeProcessId(const int parentProcessId, const char * exeFile
             {
                if(count > pidColumn && count > ppidColumn && strtoul(tokens[ppidColumn], null, 0) == parentProcessId)
                {
-                  pid = strtoul(tokens[pidColumn], null, 0);
+                  pid = (uint)strtoul(tokens[pidColumn], null, 0);
                   break;
                }
             }
index 862027c..824f8ee 100644 (file)
@@ -1397,7 +1397,7 @@ class CodeEditor : Window
                   char * s;
                   s = PrintString($"The ", fileName, $" file is not part of any project.\n", 
                      $"It can't be compiled.");
-                  MessageBox { type = ok, parent = ide, master = ide, text = $"File not in project error", contents = s }.Modal();
+                  MessageBox { type = ok, /*parent = ide, */master = ide, text = $"File not in project error", contents = s }.Modal();
                   delete s;
                   return false;
                }
index 973993e..5a128ad 100644 (file)
@@ -258,7 +258,7 @@ class WatchMultiLineString : String
          char * string = this;
          char actualString[8196];
          int c, len = 0;
-         for(c = 0; (ch = string[c]); c++)
+         for(c = 0; (ch = string[c]) && len < sizeof(actualString)-1; c++)
          {
             if(ch == '\t') { actualString[len++] = '\\'; actualString[len++] = 't'; }
             else if(ch == '\r') { actualString[len++] = '\\'; actualString[len++] = 'r'; }