We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f8f7fd2 commit 85f1af5Copy full SHA for 85f1af5
ext/fileinfo/create_data_file.php
@@ -6,13 +6,19 @@
6
$dta_l = strlen($dta);
7
$j = 0;
8
9
- echo "const unsigned char php_magic_database[$dta_l] = {\n";
+ echo "const unsigned char php_magic_database[$dta_l] =\n";
10
for ($i = 0; $i < $dta_l; $i++) {
11
- printf("0x%02X, ", ord($dta[$i]));
+ if ($j % 16 == 0) {
12
+ echo '"';
13
+ }
14
+ printf("\\x%02X", ord($dta[$i]));
15
if ($j % 16 == 15) {
- echo "\n";
16
+ echo "\"\n";
17
}
18
$j++;
19
- echo "};\n";
20
+ if ($j % 16 > 0) {
21
22
23
+ echo ";\n";
24
?>
0 commit comments