--- src/scheduler.cc/samples/fifo/fifo.c.orig 2010-11-11 12:59:08.520644232 +0000 +++ src/scheduler.cc/samples/fifo/fifo.c 2010-11-11 13:03:04.598143314 +0000 @@ -622,13 +622,16 @@ * returns success/failure - see pbs_errno for more info * */ + +#define RUJ_BUFSIZ 1024 + int run_update_job(int pbs_sd, server_info *sinfo, queue_info *qinfo, job_info *jinfo) { int ret; /* return code from pbs_runjob() */ node_info *best_node = NULL; /* best node to run job on */ char *best_node_name = NULL; /* name of best node */ - char buf[256] = {'\0'}; /* generic buffer - comments & logging*/ + char buf[RUJ_BUFSIZ] = {'\0'}; /* generic buffer - comments & logging*/ char timebuf[128]; /* buffer to hold the time and date */ resource_req *res; /* ptr to the resource of ncpus */ int ncpus; /* numeric amount of resource ncpus */ @@ -643,12 +646,12 @@ if (best_node != NULL) { best_node_name = best_node -> name; - sprintf(buf, "Job run on node %s - %s", best_node_name, timebuf); + snprintf(buf, RUJ_BUFSIZ, "Job run on node %s - %s", best_node_name, timebuf); } } if (best_node == NULL) - sprintf(buf, "Job %s", timebuf); + snprintf(buf, RUJ_BUFSIZ, "Job %s", timebuf); update_job_comment(pbs_sd, jinfo, buf); @@ -698,7 +701,7 @@ else { errmsg = pbs_geterrmsg(pbs_sd); - sprintf(buf, "Not Running - PBS Error: %s", errmsg); + snprintf(buf, RUJ_BUFSIZ, "Not Running - PBS Error: %s", errmsg); update_job_comment(pbs_sd, jinfo, buf); }