Skip to content

Commit 70b3f93

Browse files
authored
Fix %lx, %lu, %ld, %llx, %llu, %lld (#14791)
1 parent 24e9c93 commit 70b3f93

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Crashlytics/Crashlytics/Helpers/FIRCLSInternalLogging.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,29 @@ void FIRCLSSDKFileLog(FIRCLSInternalLogLevel level, const char* format, ...) {
8383
if (!string) {
8484
string = "(null)";
8585
}
86-
8786
write(fd, string, strlen(string));
8887
} break;
8988
case 'x': {
9089
unsigned int value = va_arg(args, unsigned int);
9190
FIRCLSFileFDWriteUInt64(fd, value, true);
9291
} break;
92+
case 'l': {
93+
// llx, llu, lld
94+
if (idx + 1 < formatLength && format[idx + 1] == 'l') {
95+
idx ++;
96+
}
97+
98+
//lx, lu, ld
99+
if (idx + 1 < formatLength) {
100+
uint64_t value = va_arg(args, uint64_t);
101+
if (format[idx + 1] == 'x') {
102+
FIRCLSFileFDWriteUInt64(fd, value, true);
103+
} else if (format[idx + 1] == 'd' || format[idx + 1] == 'u') {
104+
FIRCLSFileFDWriteUInt64(fd, value, false);
105+
}
106+
idx ++;
107+
}
108+
} break;
93109
default:
94110
// unhandled, back up to write out the percent + the format char
95111
write(fd, &format[idx - 1], 2);

0 commit comments

Comments
 (0)