Skip to content

Commit a897acc

Browse files
committed
(fix) lib: getPatternSizeInfo()
1 parent d6dc167 commit a897acc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/src/main/java/org/pcre4j/Pcre2Code.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,27 +186,27 @@ private int getPatternIntInfo(int info) {
186186
* @return the size information as long
187187
*/
188188
private long getPatternSizeInfo(int info) {
189-
final var infoSize = api.patternInfo(handle, IPcre2.INFO_FRAMESIZE);
189+
final var infoSize = api.patternInfo(handle, info);
190190

191191
if (infoSize == 4) {
192192
final var where = new int[1];
193-
final var error = api.patternInfo(handle, IPcre2.INFO_FRAMESIZE, where);
193+
final var error = api.patternInfo(handle, info, where);
194194
if (error != 0) {
195195
throw new IllegalStateException(Pcre4jUtils.getErrorMessage(api, error));
196196
}
197197

198198
return where[0];
199199
} else if (infoSize == 8) {
200200
final var where = new long[1];
201-
final var error = api.patternInfo(handle, IPcre2.INFO_FRAMESIZE, where);
201+
final var error = api.patternInfo(handle, info, where);
202202
if (error != 0) {
203203
throw new IllegalStateException(Pcre4jUtils.getErrorMessage(api, error));
204204
}
205205

206206
return where[0];
207207
}
208208

209-
throw new Pcre2PatternInfoSizeError(Pcre2PatternInfo.valueOf(IPcre2.INFO_FRAMESIZE).orElseThrow(), infoSize);
209+
throw new Pcre2PatternInfoSizeError(Pcre2PatternInfo.valueOf(info).orElseThrow(), infoSize);
210210
}
211211

212212
/**

0 commit comments

Comments
 (0)