On 01/31/11 04:02 AM, Erkki Seppälä wrote:
> Cannot reach dead expression "0U" inside statement "if (1U + (target_dir ? 
> strl..."
> 
> Reviewed-by: Ander Conselvan de Oliveira 
> <[email protected]>
> Signed-off-by: Erkki Seppälä <[email protected]>
> ---
>  src/xlibi18n/lcFile.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/src/xlibi18n/lcFile.c b/src/xlibi18n/lcFile.c
> index d7e375e..18756c1 100644
> --- a/src/xlibi18n/lcFile.c
> +++ b/src/xlibi18n/lcFile.c
> @@ -685,8 +685,7 @@ _XlcLocaleDirName(char *dir_name, size_t dir_len, char 
> *lc_name)
>               Xfree(name);
>           continue;
>       }
> -     if ((1 + (target_dir ? strlen (target_dir) : 0) +
> -          strlen("locale.dir")) < PATH_MAX) {
> +     if ((1 + strlen (target_dir) + strlen("locale.dir")) < PATH_MAX) {
>           sprintf(buf, "%s/locale.dir", target_dir);
>           target_name = resolve_name(name, buf, RtoL);
>       }

This could probably be squashed (as in "git rebase --interactive") with the
previous patch #24, since they are the exact same fix in two functions in the
same source.   Both could use a better/shorter subject/summary/shortlog line
too.

Both could also just be rewritten to use snprintf now that it is universally
available on our target platforms instead of manually checking strlen's, but
the fix here is appropriate even in the meantime, so:

Reviewed-by: Alan Coopersmith <[email protected]>

-- 
        -Alan Coopersmith-        [email protected]
         Oracle Solaris Platform Engineering: X Window System

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to