|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-12-28 03:44 UTC] honey at internot dot info
Description:
------------
Hi,
In /ext/standard/formatted_print.c:
158 while (magn > 0 && i > 0);
Should it be "> 0) {"?
158 while (magn > 0 && i > 0);
159 if (neg) {
160 numbuf[--i] = '-';
Thanks,
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Mar 15 23:00:01 2026 UTC |
while() is part of do/while construct, so it can not be "> 0) {". In theory, it can happen that i goes down to 0, in practice due to NUM_BUF_SIZE being 500, i starts with 499, which means magn should be at least 10^500 for this to happen, or occupy about 1661 bits. Since magn is defined as long and no known system where PHP runs has longs of this size, this does not seem to be a real issue. We could probably change the condition to i > 1 just to be nicer but I see no real issue there.