chapel-lang/chapel — pull request #909 by hildeth (2014-11-23 08:09:01+00:00)
Title: Fix coverity1241468

Coverity is complaining about a negative return from _ltoa_convert defined in
qio_formatted.c.

It is easy enough to rewrite this routine so that it returns a result that can never be
negative. Hopefully, that will quiet Coverity on this issue.

Redefined the return value from the number of characters to skip *before* encountering the
start of the converted number to the *position* of the first valid character. Before, the
return value could range from [-1..tmplen-2]. Now its range is [0..tmplen-1].

I changed the client code to accommodate this new definition of the return value
(basically subtracted 1 from it).

I changed the return type to size_t, which is an unsigned type so it can't go below zero.