Skip to content

Commit

Permalink
R CMD check happiness on gcc-8 (-Wstringop-truncation)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwijffels committed Sep 11, 2018
1 parent b7a92ca commit 19412d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions R/modelling.R
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ crf <- function(x, y, group,
#' @export
as.crf <- function(file, ...){
ldots <- list()
stopifnot(file.exists(file))
object <- crfsuite_model(file)
for(element in c("method", "type", "options", "attribute_names", "log", "FUN", "ldots")){
object[[element]] <- ldots[[element]]
Expand Down
10 changes: 8 additions & 2 deletions src/cqdb/src/cqdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ int cqdb_writer_close(cqdb_writer_t* dbw)
}

/* Initialize the file header. */
strncpy((char*)header.chunkid, CHUNKID, 4);
// Make R CMD check happy
// strncpy((char*)header.chunkid, CHUNKID, 4);
memcpy((char*)header.chunkid, CHUNKID, 4);
// END make R CMD check happy
header.flag = 0;
header.byteorder = BYTEORDER_CHECK;
header.bwd_offset = 0;
Expand Down Expand Up @@ -466,7 +469,10 @@ cqdb_t* cqdb_reader(const void *buffer, size_t size)

/* Read the database header. */
p = db->buffer;
strncpy((char*)db->header.chunkid, (const char*)p, 4);
// Make R CMD check happy
//strncpy((char*)db->header.chunkid, (const char*)p, 4);
memcpy((char*)db->header.chunkid, (const char*)p, 4);
// END make R CMD check happy
p += sizeof(uint32_t);
db->header.size = read_uint32(p);
p += sizeof(uint32_t);
Expand Down

0 comments on commit 19412d0

Please sign in to comment.