--- freem/src/ssvn_global.c 2025/01/19 02:04:04 1.1 +++ freem/src/ssvn_global.c 2025/03/22 18:43:54 1.5 @@ -1,23 +1,11 @@ /* - * * - * * * - * * * - * *************** - * * * * * - * * MUMPS * - * * * * * - * *************** - * * * - * * * - * * - * - * ssvn_global.c - * ^$GLOBAL ssv + * $Id: ssvn_global.c,v 1.5 2025/03/22 18:43:54 snw Exp $ + * ^$GLOBAL ssvn * * - * Author: Serena Willis + * Author: Serena Willis * Copyright (C) 1998 MUG Deutschland - * Copyright (C) 2020 Coherent Logic Development LLC + * Copyright (C) 2020, 2025 Coherent Logic Development LLC * * * This file is part of FreeM. @@ -35,6 +23,16 @@ * You should have received a copy of the GNU Affero Public License * along with FreeM. If not, see . * + * $Log: ssvn_global.c,v $ + * Revision 1.5 2025/03/22 18:43:54 snw + * Make STRLEN 255 chars and add BIGSTR macro for larger buffers + * + * Revision 1.4 2025/03/09 19:50:47 snw + * Second phase of REUSE compliance and header reformat + * + * + * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC + * SPDX-License-Identifier: AGPL-3.0-or-later **/ #include @@ -126,11 +124,11 @@ void frm_decode_block(db_blockinfo *b, c void ssvn_global(short action, char *key, char *data) { char gb_ns[STRLEN]; - char gb_path[STRLEN]; - char gb_cpath[STRLEN]; + char gb_path[PATHLEN]; + char gb_cpath[PATHLEN]; - char ns_key[256]; - char ns_data[256]; + char ns_key[STRLEN]; + char ns_data[STRLEN]; long blkcount; @@ -167,7 +165,7 @@ void ssvn_global(short action, char *key goto done; } - snprintf (ns_key, 255, "^$SYSTEM\202MAPPINGS\202GLOBAL\202^%s\201", mref_get_subscript (r, 0)); + snprintf (ns_key, STRLEN, "^$SYSTEM\202MAPPINGS\202GLOBAL\202^%s\201", mref_get_subscript (r, 0)); global (kill_sym, ns_key, data); goto done; @@ -230,7 +228,7 @@ void ssvn_global(short action, char *key goto done; } - sprintf (data, "%d\201", bi->blockcount); + sprintf (data, "%ld\201", bi->blockcount); merr_raise (OK); goto done; } @@ -253,7 +251,7 @@ void ssvn_global(short action, char *key } - sprintf (data, "%d\201", bi->rlptr); + sprintf (data, "%ld\201", bi->rlptr); merr_raise (OK); goto done; } @@ -264,7 +262,7 @@ void ssvn_global(short action, char *key goto done; } - sprintf (data, "%d\201", bi->free_offset); + sprintf (data, "%ld\201", bi->free_offset); merr_raise (OK); goto done; } @@ -275,7 +273,7 @@ void ssvn_global(short action, char *key goto done; } - sprintf (data, "%d\201", bi->llptr); + sprintf (data, "%ld\201", bi->llptr); merr_raise (OK); goto done; } @@ -382,20 +380,20 @@ done: short frm_global_exists(char *gbl_namespace, char *gbl_path, char *global_name) { char *gpth; - char glofile[STRLEN]; + char glofile[PATHLEN]; char goobuf[STRLEN]; - char mapk_buf[255]; - char mapd_buf[255]; - char old_ns[255]; + char mapk_buf[STRLEN]; + char mapd_buf[STRLEN]; + char old_ns[STRLEN]; int ierr_sav = OK; if (global_name[0] != '^') { - snprintf (mapk_buf, 254, "^$SYSTEM\202MAPPINGS\202GLOBAL\202^%s\201", global_name); + snprintf (mapk_buf, STRLEN, "^$SYSTEM\202MAPPINGS\202GLOBAL\202^%s\201", global_name); } else { - snprintf (mapk_buf, 254, "^$SYSTEM\202MAPPINGS\202GLOBAL\202%s\201", global_name); + snprintf (mapk_buf, STRLEN, "^$SYSTEM\202MAPPINGS\202GLOBAL\202%s\201", global_name); } global (get_sym, mapk_buf, mapd_buf); @@ -435,10 +433,10 @@ short frm_global_exists(char *gbl_namesp stcnv_m2c (goobuf); if (global_name[0] != '^') { - snprintf (glofile, STRLEN - 1, "%s/^%s", goobuf, global_name); + snprintf (glofile, PATHLEN, "%s/^%s", goobuf, global_name); } else { - snprintf (glofile, STRLEN - 1, "%s/%s", goobuf, global_name); + snprintf (glofile, PATHLEN, "%s/%s", goobuf, global_name); } strcpy (gbl_path, glofile);