Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23ed2ba

Browse files
committed
Another portability fix for tzcode2016g update.
clang points out that SIZE_MAX wouldn't fit into an int, which meansthis comparison is pretty useless. Per report from Thomas Munro.
1 parentad90ac4 commit23ed2ba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/timezone/zic.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,8 @@ growalloc(void *ptr, size_t itemsize, int nitems, int *nitems_alloc)
424424
else
425425
{
426426
intnitems_max=INT_MAX-WORK_AROUND_QTBUG_53071;
427-
intamax=nitems_max<SIZE_MAX ?nitems_max :SIZE_MAX;
428427

429-
if ((amax-1) /3*2<*nitems_alloc)
428+
if ((nitems_max-1) /3*2<*nitems_alloc)
430429
memory_exhausted(_("int overflow"));
431430
*nitems_alloc=*nitems_alloc+ (*nitems_alloc >>1)+1;
432431
returnerealloc(ptr,size_product(*nitems_alloc,itemsize));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp