--- freem/src/fma_routines.c 2025/03/22 18:43:54 1.4 +++ freem/src/fma_routines.c 2025/04/13 04:22:43 1.5 @@ -1,5 +1,5 @@ /* - * $Id: fma_routines.c,v 1.4 2025/03/22 18:43:54 snw Exp $ + * $Id: fma_routines.c,v 1.5 2025/04/13 04:22:43 snw Exp $ * fmadm - routines * * @@ -24,6 +24,9 @@ * along with FreeM. If not, see . * * $Log: fma_routines.c,v $ + * Revision 1.5 2025/04/13 04:22:43 snw + * Fix snprintf calls + * * Revision 1.4 2025/03/22 18:43:54 snw * Make STRLEN 255 chars and add BIGSTR macro for larger buffers * @@ -358,13 +361,13 @@ int fma_routines_import (int optc, char case '%': pct_loaded++; - snprintf(roufile, PATH_MAX, "%s/%s.m", pct_rtn_path, parsed_line); + snprintf(roufile, PATH_MAX - 1, "%s/%s.m", pct_rtn_path, parsed_line); break; default: usr_loaded++; - snprintf(roufile, PATH_MAX, "%s/%s.m", usr_rtn_path, parsed_line); + snprintf(roufile, PATH_MAX - 1, "%s/%s.m", usr_rtn_path, parsed_line); break; }