#include "smalloc.h"
#include "gmx_fatal.h"
#include "md_logging.h"
+#include "string2.h"
#ifdef GMX_LIB_MPI
#include <mpi.h>
{
if (n > 0)
{
- sprintf(num,"%10d",n);
+ snprintf(num,sizeof(num),"%10d",n);
if (nthreads < 0)
- sprintf(thstr, "N/A");
+ snprintf(thstr, sizeof(thstr), "N/A");
else
- sprintf(thstr, "%4d", nthreads);
+ snprintf(thstr, sizeof(thstr), "%4d", nthreads);
}
else
{
if (n > 0)
{
- sprintf(num, "%10d", n);
- sprintf(avg_perf, "%10.3f", t/n);
+ snprintf(num, sizeof(num), "%10d", n);
+ snprintf(avg_perf, sizeof(avg_perf), "%10.3f", t/n);
}
else
{
{
for(j=0; j<ewcNR; j++)
{
- sprintf(buf,"%-9s",wcn[i]);
+ snprintf(buf,9,"%-9s",wcn[i]);
buf[9] = ' ';
- sprintf(buf+10,"%-9s",wcn[j]);
+ snprintf(buf+10,9,"%-9s",wcn[j]);
buf[19] = '\0';
print_cycles(fplog,c2t,buf,nnodes,
is_pme_counter(i) ? npme : npp,