Skip to content

Commit 33aca40

Browse files
author
ripley
committed
use snprintf
git-svn-id: https://svn.r-project.org/R-packages/trunk@8166 694ef91d-65df-0310-b7bb-92e67a308ead
1 parent 29c495e commit 33aca40

7 files changed

Lines changed: 15 additions & 11 deletions

File tree

XML/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: XML
2-
Version: 3.99-0.12
2+
Version: 3.99-0.13
33
Authors@R: c(person("CRAN Team", role = c('ctb', 'cre'),
44
email = "CRAN@r-project.org",
55
comment = "de facto maintainer since 2013"),

XML/src/DocParse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ RS_XML(AttributeList)(xmlNodePtr node, R_XMLSettings *parserSettings)
14471447
if(atts->name) {
14481448
if(addNSPrefix && atts->ns && atts->ns->prefix) {
14491449
char buf[400];
1450-
sprintf(buf, "%s:%s", atts->ns->prefix, atts->name);
1450+
snprintf(buf, 400, "%s:%s", atts->ns->prefix, atts->name);
14511451
SET_STRING_ELT(ans_names, i, ENC_COPY_TO_USER_STRING(buf));
14521452
} else
14531453
SET_STRING_ELT(ans_names, i, ENC_COPY_TO_USER_STRING(XMLCHAR_TO_CHAR(atts->name)));

XML/src/Utils.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ RS_XML(treeApply)(USER_OBJECT_ rtree, USER_OBJECT_ function, USER_OBJECT_ args)
106106

107107
#include <stdarg.h>
108108

109-
void localXmlParserPrintFileInfo(xmlParserInputPtr input, char *buf);
109+
void localXmlParserPrintFileInfo(xmlParserInputPtr input, char *buf, int nbuf);
110110

111111

112112
#ifndef USE_LINKED_ERROR_HANDLER
@@ -128,7 +128,7 @@ void xmlParserError(void *ctx, const char *msg, ...)
128128
memset(buf , '\0', sizeof(buf)/sizeof(buf[0]));
129129

130130
/* Insert the file and line number. */
131-
localXmlParserPrintFileInfo(ctxt->input, buf);
131+
localXmlParserPrintFileInfo(ctxt->input, buf, 3000);
132132
/* Move to the end of the buffer's contents. */
133133
tmp = buf + strlen(buf);
134134

@@ -169,13 +169,13 @@ RSXML_setErrorHandlers(void)
169169
Write the file name and the current line number into the specified
170170
string.
171171
*/
172-
void localXmlParserPrintFileInfo(xmlParserInputPtr input, char *buf) {
172+
void localXmlParserPrintFileInfo(xmlParserInputPtr input, char *buf, int nbuf) {
173173
if (input != NULL) {
174174
if (input->filename)
175-
sprintf(buf, "%s:%d: ", input->filename,
175+
snprintf(buf, nbuf, "%s:%d: ", input->filename,
176176
input->line);
177177
else
178-
sprintf(buf, "Entity: line %d: ", input->line);
178+
snprintf(buf, nbuf, "Entity: line %d: ", input->line);
179179
}
180180
}
181181

XML/src/XMLHashTree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static const char * const nodeElementNames[] = {
6363
uniqueness. Ignore the next definition in the comment!
6464
#define SET_NODE_NAME(x, id) sprintf(x, "%d", id)
6565
*/
66-
#define SET_NODE_NAME(x, id, node) sprintf(x, "%p", (void *)node)
66+
#define SET_NODE_NAME(x, id, node) snprintf(x, 20, "%p", (void *)node)
6767

6868

6969
SEXP

boot/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
version 1.3-28.1 2022-11-21
2+
3+
Update URL in man/EEF.profile.Rd at KH's request.
4+
15
version 1.3-28 2021-04-17
26

37
Update fr translations.

boot/DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: boot
22
Priority: recommended
3-
Version: 1.3-28
4-
Date: 2021-04-16
3+
Version: 1.3-28.1
4+
Date: 2022-11-21
55
Authors@R: c(person("Angelo", "Canty", role = "aut",
66
email = "cantya@mcmaster.ca"),
77
person("Brian", "Ripley", role = c("aut", "trl", "cre"),

boot/man/EEF.profile.Rd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The functions are not intended for general use and are not supported
3333
as part of the \code{boot}package. For more general and more robust
3434
code to calculate empirical likelihoods see Professor A. B. Owen's
3535
empirical likelihood home page at the URL
36-
\url{https://statweb.stanford.edu/~owen/empirical/}.
36+
\url{https://artowen.su.domains/empirical/}
3737
}
3838
\value{
3939
A matrix with \code{n.t} rows. The first column contains the

0 commit comments

Comments
 (0)