Bug 1060419 - use result of SprintfLiteral in Printf.cpp; r?froydnj
MozReview-Commit-ID: HSHAeKVu6PU
--- a/mozglue/misc/Printf.cpp
+++ b/mozglue/misc/Printf.cpp
@@ -271,19 +271,20 @@ mozilla::PrintfTarget::cvt_f(double d, c
{
const char* p = fin;
while (*p) {
MOZ_ASSERT(*p != 'L');
p++;
}
}
#endif
- SprintfLiteral(fout, fin, d);
+ size_t len = SprintfLiteral(fout, fin, d);
+ MOZ_ASSERT(len <= sizeof(fout));
- return emit(fout, strlen(fout));
+ return emit(fout, len);
}
/*
* Convert a string into its printable form. "width" is the output
* width. "prec" is the maximum number of characters of "s" to output,
* where -1 means until NUL.
*/
bool