Hi,
Multiple issues found by Coverity Scan.

CID 210502 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
CID 210590 (#1 of 1): Infinite loop (INFINITE_LOOP)
CID 210665 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)

--- a\srcscintilla\iup_scintilladlg.c   Fri Jan 19 16:00:51 2018
+++ b\srcscintilla\iup_scintilladlg.c   Fri Jan 19 16:17:11 2018
@@ -299,6 +299,11 @@
   int tabSize = IupGetInt(multitext, "TABSIZE");
   int lin, col, i, j;
 
+  if (tabSize == 0) 
+  {
+     return;
+  }
+
   for (i = count - 1; i >= 0; i--)
   {
     int spacesToNextTab;
@@ -325,6 +330,11 @@
   int tabSize = IupGetInt(multitext, "TABSIZE");
   int lin, col, i;
 
+  if (tabSize == 0)
+  {
+     return;
+  }
+
   for (i = count - 1; i >= 0; i--)
   {
     int nSpaces, tabStop;
@@ -591,7 +601,7 @@
   int i;
 
   /* clear everything before saving */
-  for (i = 1; i <= count; count++)
+  for (i = 1; i <= count; i++)
     IupConfigSetVariableStrId(projectConfig, "ProjectFiles", "File", i, NULL);
   IupConfigSetVariableStr(projectConfig, "ProjectFiles", "Count", NULL);
 
Best.
Ranier

Attachment: iup_scintilladlg.patch
Description: iup_scintilladlg.patch

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to