diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-12-01 11:32:50 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-01 17:13:43 +0100 |
commit | 62fc97056887f313ef13ed85d0095dc1b3b69202 (patch) | |
tree | 0ea41dd1746225a2e33d2b12cea112004356557f /src/dbus/qdbuserror.cpp | |
parent | 43ee10518ab9870cc6f39cedc1febf9b7c57ebff (diff) |
Fix wrong error message count in QDBusError
Don't pass the pointer errorMessages_string - 1 to strcmp().
-1 marks the end should not be used for the pointer arithmetic
in get(const char *name)
Change-Id: I5ec239c63f074d104d441511294554f21fd6eccd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus/qdbuserror.cpp')
-rw-r--r-- | src/dbus/qdbuserror.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dbus/qdbuserror.cpp b/src/dbus/qdbuserror.cpp index 37523c0970..52370e8e1c 100644 --- a/src/dbus/qdbuserror.cpp +++ b/src/dbus/qdbuserror.cpp @@ -142,7 +142,7 @@ static const int errorMessages_indices[] = { }; static const int errorMessages_count = sizeof errorMessages_indices / - sizeof errorMessages_indices[0]; + sizeof errorMessages_indices[0] - 1; static inline const char *get(QDBusError::ErrorType code) { |