From adc17549c5f0485a30a87e7674c7779ef3155d6c Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 12 May 2012 13:16:29 +0200 Subject: syntx of null pointer dereference checks (bzr r11358) --- src/xml/repr-util.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/xml/repr-util.cpp') diff --git a/src/xml/repr-util.cpp b/src/xml/repr-util.cpp index 6899e77ee..5b8ab12ae 100644 --- a/src/xml/repr-util.cpp +++ b/src/xml/repr-util.cpp @@ -261,8 +261,13 @@ gchar const *sp_xml_ns_uri_prefix(gchar const *uri, gchar const *suggested) GQuark const prefix_key=g_quark_from_string(suggested); SPXMLNs *found=namespaces; - while ( found && found->prefix != prefix_key ) { - found = found->next; + while (found) { + if (found->prefix != prefix_key) { + found = found->next; + } + else { + break; + } } if (found) { // prefix already used? -- cgit v1.2.3