[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: subversion/libsvn_subr/path.c:1259: possible bad if ?

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 08 May 2015 09:33:17 +0100

David Binderman <dcb314_at_hotmail.com> writes:

> [subversion/libsvn_subr/path.c:1259]: (warning) Char literal compared
> with pointer 'last_dot'. Did you intend to dereference it?
>
>   if (last_dot && (last_dot + 1 != '\0'))
>
> Maybe
>
>   if (last_dot && (last_dot[ 1] != '\0'))

That has been fixed:

r1548480 | philip | 2013-12-06 10:01:17 +0000 (Fri, 06 Dec 2013) | 11 lines

* subversion/libsvn_subr/path.c
  (svn_path_splitext): Fixed correct pointer comparison to NULL to check
  for end of string, instead of checking if the character itself was NULL.
  The only output change is that a pool allocated "" is now a static "".

* subversion/tests/libsvn_subr/path-test.c
  (test_path_splitext): New case.

Patch by: eric{_AT_}lubin.us
          me

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2015-05-08 10:33:38 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.