summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2014-03-22 17:33:55 +0100
committerAlbert Astals Cid <aacid@kde.org>2014-03-22 17:35:42 +0100
commit37ad83d69bd1d10da6ea1eb559c4bd320917ae25 (patch)
treeb7fc1300adff12b13f0e566c3ecc36ef03ee6b81
parent3535d658095ffa49ef8615d69843afa9c5ada061 (diff)
Reorder the if check condition
I think the previous condition was correct anyway because of the extra -1 in the i check but it really makes more sense to have the i check first Bug #76478
-rw-r--r--goo/gfile.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/goo/gfile.cc b/goo/gfile.cc
index 44beddd5..6fd4cbad 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -19,7 +19,7 @@
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2008 Adam Batkin <adam@batkin.net>
// Copyright (C) 2008, 2010, 2012, 2013 Hib Eris <hib@hiberis.nl>
-// Copyright (C) 2009, 2012 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2009, 2012, 2014 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com>
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
@@ -492,7 +492,7 @@ FILE *openFile(const char *path, const char *mode) {
}
}
wPath[i] = (wchar_t)0;
- for (i = 0; mode[i] && i < sizeof(mode) - 1; ++i) {
+ for (i = 0; (i < sizeof(mode) - 1) && mode[i]; ++i) {
wMode[i] = (wchar_t)(mode[i] & 0xff);
}
wMode[i] = (wchar_t)0;