summaryrefslogtreecommitdiff
path: root/fluid
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2021-02-18 16:37:51 -0800
committerGreg Ercolano <erco@seriss.com>2021-02-18 16:37:51 -0800
commit3c37cd033bcc1cc760868bb66772441bb8129acd (patch)
treeee432ca2d3c8c32d3326d0c0b0058166bd665323 /fluid
parent389760c1c646d8c8c2991627d828ba76e89393c2 (diff)
Solves all "conversion" warnings in fluid for issue #109.
Diffstat (limited to 'fluid')
-rw-r--r--fluid/ExternalCodeEditor_WIN32.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/fluid/ExternalCodeEditor_WIN32.cxx b/fluid/ExternalCodeEditor_WIN32.cxx
index 45ad61288..b05adc638 100644
--- a/fluid/ExternalCodeEditor_WIN32.cxx
+++ b/fluid/ExternalCodeEditor_WIN32.cxx
@@ -242,17 +242,18 @@ int ExternalCodeEditor::handle_changes(const char **code, int force) {
// Changes? Load file. Be sure to fallthru to CloseHandle()
int ret = 0;
if ( changed || force ) {
- char *buf = (char*)malloc(fsize.QuadPart + 1);
+ size_t buflen = size_t(fsize.QuadPart);
+ char *buf = (char*)malloc(buflen + 1);
DWORD count;
- if ( ReadFile(fh, buf, fsize.QuadPart, &count, 0) == 0 ) {
+ if ( ReadFile(fh, buf, buflen, &count, 0) == 0 ) {
fl_alert("ERROR: ReadFile() failed for %s: %s",
filename(), get_ms_errmsg());
free((void*)buf); buf = 0;
ret = -1; // fallthru to CloseHandle()
- } else if ( count != fsize.QuadPart ) {
+ } else if ( count != buflen ) {
fl_alert("ERROR: ReadFile() failed for %s:\n"
"expected %ld bytes, got %ld",
- filename(), long(fsize.QuadPart), long(count));
+ filename(), long(buflen), long(count));
free((void*)buf); buf = 0;
ret = -1; // fallthru to CloseHandle()
} else {