diff options
author | nyamatongwe <devnull@localhost> | 2009-07-12 23:01:15 +0000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2009-07-12 23:01:15 +0000 |
commit | da74fac3e81338d08b8b0c196b92bc298be9673e (patch) | |
tree | 6a8eb71edc5b0f713eac8704ff7fb63b1cf00afc /win32/PlatWin.cxx | |
parent | e88520dcbd24f2bcbf6ebe9d49cb2370b9ce8cd1 (diff) | |
download | scintilla-mirror-da74fac3e81338d08b8b0c196b92bc298be9673e.tar.gz |
Since exception handling now turned on, do not check return value from new.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r-- | win32/PlatWin.cxx | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 54eb5e3cc..fefd523a1 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -1555,36 +1555,34 @@ void ListBoxX::SetList(const char *list, char separator, char typesep) { Clear(); int size = strlen(list) + 1; char *words = new char[size]; - if (words) { - lti.SetWords(words); - memcpy(words, list, size); - char *startword = words; - char *numword = NULL; - int i = 0; - for (; words[i]; i++) { - if (words[i] == separator) { - words[i] = '\0'; - if (numword) - *numword = '\0'; - AppendListItem(startword, numword); - startword = words + i + 1; - numword = NULL; - } else if (words[i] == typesep) { - numword = words + i; - } - } - if (startword) { + lti.SetWords(words); + memcpy(words, list, size); + char *startword = words; + char *numword = NULL; + int i = 0; + for (; words[i]; i++) { + if (words[i] == separator) { + words[i] = '\0'; if (numword) *numword = '\0'; AppendListItem(startword, numword); + startword = words + i + 1; + numword = NULL; + } else if (words[i] == typesep) { + numword = words + i; } + } + if (startword) { + if (numword) + *numword = '\0'; + AppendListItem(startword, numword); + } - // Finally populate the listbox itself with the correct number of items - int count = lti.Count(); - ::SendMessage(lb, LB_INITSTORAGE, count, 0); - for (int j=0; j<count; j++) { - ::SendMessage(lb, LB_ADDSTRING, 0, j+1); - } + // Finally populate the listbox itself with the correct number of items + int count = lti.Count(); + ::SendMessage(lb, LB_INITSTORAGE, count, 0); + for (int j=0; j<count; j++) { + ::SendMessage(lb, LB_ADDSTRING, 0, j+1); } SetRedraw(true); } |