--- freem/src/fma_journals.c 2025/03/09 15:20:18 1.2 +++ freem/src/fma_journals.c 2025/04/13 04:22:43 1.5 @@ -1,23 +1,11 @@ /* - * * - * * * - * * * - * *************** - * * * * * - * * MUMPS * - * * * * * - * *************** - * * * - * * * - * * - * - * fma_journals.c + * $Id: fma_journals.c,v 1.5 2025/04/13 04:22:43 snw Exp $ * Journal utilities for fmadm * * * 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,19 @@ * You should have received a copy of the GNU Affero Public License * along with FreeM. If not, see . * + * $Log: fma_journals.c,v $ + * Revision 1.5 2025/04/13 04:22:43 snw + * Fix snprintf calls + * + * Revision 1.4 2025/04/09 19:52:02 snw + * Eliminate as many warnings as possible while building with -Wall + * + * Revision 1.3 2025/03/09 19:14:25 snw + * First phase of REUSE compliance and header reformat + * + * + * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC + * SPDX-License-Identifier: AGPL-3.0-or-later **/ #include @@ -140,7 +141,7 @@ int fma_journals_examine (int optc, char if (ent.action == JNLA_SET) { - snprintf (dbuf, 2049, "%s=%s", kbuf, ent.data); + snprintf (dbuf, sizeof (dbuf) - 1, "%s=%s", kbuf, ent.data); for (k = 0; k < strlen (dbuf); k++) { if (dbuf[k] == '\201') dbuf[k] = '\0'; @@ -163,16 +164,10 @@ int fma_journals_restore (int optc, char { register int i; - register int k; int fd; unsigned long siz; unsigned long ct; - - char kbuf[1024]; - char *tbuf; - - char dbuf[2049]; - + jnl_hdr_t hdr; jnl_ent_t ent;