Skip to content

Commit 61d78b7

Browse files
committed
Fix %lx, %lu, %ld, %llx, %llu, %lld
1 parent 912d8c0 commit 61d78b7

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Crashlytics/Crashlytics/Helpers/FIRCLSInternalLogging.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,30 @@ 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+
const char* specifierString = format[idx + 1];
101+
uint64_t value = va_arg(args, uint64_t);
102+
if (specifierString == 'x') {
103+
FIRCLSFileFDWriteUInt64(fd, value, true);
104+
} else if (specifierString == 'd' || specifierString == 'u') {
105+
FIRCLSFileFDWriteUInt64(fd, value, false);
106+
}
107+
idx ++;
108+
}
109+
} break;
93110
default:
94111
// unhandled, back up to write out the percent + the format char
95112
write(fd, &format[idx - 1], 2);

0 commit comments

Comments
 (0)