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

Commitaee5eb8

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 parentfadfe66 commitaee5eb8

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
@@ -436,9 +436,8 @@ growalloc(void *ptr, size_t itemsize, int nitems, int *nitems_alloc)
436436
else
437437
{
438438
intnitems_max=INT_MAX-WORK_AROUND_QTBUG_53071;
439-
intamax=nitems_max<SIZE_MAX ?nitems_max :SIZE_MAX;
440439

441-
if ((amax-1) /3*2<*nitems_alloc)
440+
if ((nitems_max-1) /3*2<*nitems_alloc)
442441
memory_exhausted(_("int overflow"));
443442
*nitems_alloc=*nitems_alloc+ (*nitems_alloc >>1)+1;
444443
returnerealloc(ptr,size_product(*nitems_alloc,itemsize));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp