PercentArg, // '%'
// Objective-C specific specifiers.
ObjCObjArg, // '@'
+ // GlibC specific specifiers.
+ PrintErrno, // 'm'
// Specifier ranges.
IntArgBeg = dArg,
IntArgEnd = iArg,
const char *getStart() const {
return Position;
}
+
+ bool consumesDataArgument() const {
+ switch (kind) {
+ case PercentArg:
+ case PrintErrno:
+ return false;
+ default:
+ return true;
+ }
+ }
bool isObjCArg() const { return kind >= ObjCBeg && kind <= ObjCEnd; }
bool isIntArg() const { return kind >= dArg && kind <= iArg; }
H.HandleIncompleteFormatSpecifier(Start, E - Start);
return true;
}
+
+ if (*I == '\0') {
+ // Detect spurious null characters, which are likely errors.
+ H.HandleNullChar(I);
+ return true;
+ }
// Finally, look for the conversion specifier.
const char *conversionPosition = I++;
case 'n': k = ConversionSpecifier::OutIntPtrArg; break;
case '%': k = ConversionSpecifier::PercentArg; break;
// Objective-C.
- case '@': k = ConversionSpecifier::ObjCObjArg; break;
+ case '@': k = ConversionSpecifier::ObjCObjArg; break;
+ // Glibc specific.
+ case 'm': k = ConversionSpecifier::PrintErrno; break;
}
FS.setConversionSpecifier(ConversionSpecifier(conversionPosition, k));
// We have a format specifier. Pass it to the callback.
if (!H.HandleFormatSpecifier(FSR.getValue(), FSR.getStart(),
I - FSR.getStart()))
- return false;
+ return true;
}
assert(I == E && "Format string not exhausted");
return false;