Skip to content

Commit bc5fa30

Browse files
authored
Fix format string issues (#421)
1 parent b9f65ba commit bc5fa30

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# xml2 (development version)
22

3+
* Fix format string issues detected in R-devel.
4+
35
* `xml_serialize()` now includes the document type so that `xml_unserialize()` works also for HTML documents (#407, @HenrikBengtsson).
46

57
* Remove unused dependencies on glue, withr and lifecycle (@mgirlich).

src/xml2_init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void handleGenericError(void *ctx, const char *fmt, ...)
3434

3535
va_start(arg, fmt);
3636
vsnprintf(buffer, BUFSIZ, fmt, arg);
37-
Rf_error(buffer);
37+
Rf_error("%s", buffer);
3838
}
3939

4040
// [[export]]

src/xml2_output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int xml_write_callback(SEXP con, const char * buffer, int len) {
9292
size_t write_size;
9393

9494
if ((write_size = R_WriteConnection(con, (void *) buffer, len)) != static_cast<size_t>(len)) {
95-
Rf_error("write failed, expected %l, got %l", len, write_size);
95+
Rf_error("write failed, expected %i, got %li", len, write_size);
9696
}
9797
return write_size;
9898
}

0 commit comments

Comments
 (0)