From fbc1c1cfdd2194c78e0f77393bbc060e32a74a63 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer <akohlmey@gmail.com> Date: Thu, 6 Sep 2018 09:57:10 -0400 Subject: [PATCH] replace fixed buffer sprintf() with straight fprintf() --- src/neighbor.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/neighbor.cpp b/src/neighbor.cpp index bc22fffc48..84494bfbc5 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -1408,7 +1408,6 @@ void Neighbor::init_topology() void Neighbor::print_pairwise_info() { int i,m; - char str[256]; NeighRequest *rq; FILE *out; @@ -1457,18 +1456,17 @@ void Neighbor::print_pairwise_info() rq = requests[i]; if (rq->pair) { char *pname = force->pair_match_ptr((Pair *) rq->requestor); - sprintf(str," (%d) pair %s",i+1,pname); + fprintf(out," (%d) pair %s",i+1,pname); } else if (rq->fix) { - sprintf(str," (%d) fix %s",i+1,((Fix *) rq->requestor)->style); + fprintf(out," (%d) fix %s",i+1,((Fix *) rq->requestor)->style); } else if (rq->compute) { - sprintf(str," (%d) compute %s",i+1, + fprintf(out," (%d) compute %s",i+1, ((Compute *) rq->requestor)->style); } else if (rq->command) { - sprintf(str," (%d) command %s",i+1,rq->command_style); + fprintf(out," (%d) command %s",i+1,rq->command_style); } else if (rq->neigh) { - sprintf(str," (%d) neighbor class addition",i+1); + fprintf(out," (%d) neighbor class addition",i+1); } - fprintf(out,"%s",str); if (rq->occasional) fprintf(out,", occasional"); else fprintf(out,", perpetual"); -- GitLab