|
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-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 17:00:02 2025 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.