void-packages/srcpkgs/icu/patches/buffer_size_adjust.patch
2015-11-29 17:02:48 +01:00

21 lines
877 B
Diff

The value of tmpResult may be -1 in which case setting
currentBufferSize = -1 leads to an error when trying to
allocate the buffers.
If tmpResult is less than currentBufferSize simply double
currentBufferSize until parsing the flags succeeds.
--- source/tools/pkgdata/pkgdata.cpp 2015-10-08 05:54:02.000000000 +0200
+++ source/tools/pkgdata/pkgdata.cpp 2015-11-29 16:52:09.329794090 +0100
@@ -862,7 +862,10 @@
pkgDataFlags[i] = NULL;
}
}
- currentBufferSize = tmpResult;
+ if (tmpResult > currentBufferSize)
+ currentBufferSize = tmpResult;
+ else
+ currentBufferSize *= 2;
} else if (U_FAILURE(status)) {
fprintf(stderr,"Unable to open or read \"%s\" option file. status = %s\n", o->options, u_errorName(status));
return -1;