--- freem/src/tp_check.c 2025/04/09 19:52:02 1.5 +++ freem/src/tp_check.c 2025/04/13 04:22:43 1.6 @@ -1,5 +1,5 @@ /* - * $Id: tp_check.c,v 1.5 2025/04/09 19:52:02 snw Exp $ + * $Id: tp_check.c,v 1.6 2025/04/13 04:22:43 snw Exp $ * TP global checkpointing code * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: tp_check.c,v $ + * Revision 1.6 2025/04/13 04:22:43 snw + * Fix snprintf calls + * * Revision 1.5 2025/04/09 19:52:02 snw * Eliminate as many warnings as possible while building with -Wall * @@ -93,7 +96,7 @@ cptab *cptab_insert(int tlevel, char *gl strcpy (t->file, gc_pth); stcnv_m2c (t->file); - snprintf (t->cp_file, PATHLEN, "%s.%d.%d.chk", t->file, pid, tp_level); + snprintf (t->cp_file, PATHLEN - 1, "%s.%d.%d.chk", t->file, pid, tp_level); free (gc_ns); free (gc_pth); @@ -222,6 +225,7 @@ short cptab_rollback(int tlevel) snprintf (cmd, STRLEN - 1, "/bin/cp '%s' '%s'", t->cp_file, t->file); rc = system (cmd); */ + /* TODO: support OS/2 */ rc = cp (t->file, t->cp_file); if (rc != 0) {