Skip to content

Commit 94699d2

Browse files
committed
Use suitable datatypes
1 parent f603ab5 commit 94699d2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ext/fileinfo/libmagic/funcs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ FILE_RCSID("@(#)$File: funcs.c,v 1.94 2017/11/02 20:25:39 christos Exp $")
5656
# define PREG_OFFSET_CAPTURE (1<<8)
5757
#endif
5858

59-
extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, int options);
59+
extern public void convert_libmagic_pattern(zval *pattern, char *val, size_t len, uint32_t options);
6060

6161
protected int
6262
file_printf(struct magic_set *ms, const char *fmt, ...)
6363
{
6464
va_list ap;
65-
int len;
65+
size_t len;
6666
char *buf = NULL, *newstr;
6767

6868
va_start(ap, fmt);
@@ -466,7 +466,7 @@ protected int
466466
file_replace(struct magic_set *ms, const char *pat, const char *rep)
467467
{
468468
zval patt;
469-
int opts = 0;
469+
uint32_t opts = 0;
470470
pcre_cache_entry *pce;
471471
zend_string *res;
472472
zend_string *repl;

ext/fileinfo/libmagic/softmagic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,7 @@ file_strncmp16(const char *a, const char *b, size_t len, uint32_t flags)
18291829
}
18301830

18311831
public void
1832-
convert_libmagic_pattern(zval *pattern, char *val, int len, int options)
1832+
convert_libmagic_pattern(zval *pattern, char *val, size_t len, uint32_t options)
18331833
{
18341834
int i, j=0;
18351835
zend_string *t;
@@ -2024,7 +2024,7 @@ magiccheck(struct magic_set *ms, struct magic *m)
20242024
}
20252025
case FILE_REGEX: {
20262026
zval pattern;
2027-
int options = 0;
2027+
uint32_t options = 0;
20282028
pcre_cache_entry *pce;
20292029

20302030
options |= PCRE2_MULTILINE;

0 commit comments

Comments
 (0)