--- freem/src/ssvn_zprocess.c 2025/03/22 18:43:54 1.4 +++ freem/src/ssvn_zprocess.c 2025/04/13 04:22:43 1.6 @@ -1,5 +1,5 @@ /* - * $Id: ssvn_zprocess.c,v 1.4 2025/03/22 18:43:54 snw Exp $ + * $Id: ssvn_zprocess.c,v 1.6 2025/04/13 04:22:43 snw Exp $ * ^$ZPROCESS ssvn * * @@ -24,6 +24,12 @@ * along with FreeM. If not, see . * * $Log: ssvn_zprocess.c,v $ + * Revision 1.6 2025/04/13 04:22:43 snw + * Fix snprintf calls + * + * Revision 1.5 2025/03/24 04:13:11 snw + * Replace action macro dat with fra_dat to avoid symbol conflict on OS/2 + * * Revision 1.4 2025/03/22 18:43:54 snw * Make STRLEN 255 chars and add BIGSTR macro for larger buffers * @@ -74,7 +80,7 @@ void ssvn_zprocess (short action, char * } t_pid = atol(ref->subscripts[0]); - snprintf (proc_path, PATHLEN, "/proc/%d", t_pid); + snprintf (proc_path, PATHLEN - 1, "/proc/%d", t_pid); strncpy (verb, ref->subscripts[1], STRLEN); @@ -88,10 +94,10 @@ void ssvn_zprocess (short action, char * if (strcmp (verb, "EXISTS") == 0) { if (kill (t_pid, 0) == 0) { - snprintf (data, STRLEN, "%d\201", 1); + snprintf (data, STRLEN - 1, "%d\201", 1); } else { - snprintf (data, STRLEN, "%d\201", 0); + snprintf (data, STRLEN - 1, "%d\201", 0); } free (kbuf); @@ -112,7 +118,7 @@ void ssvn_zprocess (short action, char * strncpy (attrib, ref->subscripts[2], 255); - snprintf (fpath, PATHLEN, "/proc/%d/%s", t_pid, attrib); + snprintf (fpath, PATHLEN - 1, "/proc/%d/%s", t_pid, attrib); if ((fp = fopen (fpath, "r")) == NULL) { @@ -197,7 +203,7 @@ void ssvn_zprocess (short action, char * merr_raise (OK); return; - case dat: + case fra_dat: case fra_order: case fra_query: case bigquery: