Diff for /freem/src/events.c between versions 1.1.1.1 and 1.5

version 1.1.1.1, 2025/01/19 02:04:04 version 1.5, 2025/04/13 04:22:43
Line 1 Line 1
 /*  /*
  *                            *   *   $Id$
  *                           * *  
  *                          *   *  
  *                     ***************  
  *                      * *       * *  
  *                       *  MUMPS  *  
  *                      * *       * *  
  *                     ***************  
  *                          *   *  
  *                           * *  
  *                            *  
  *  
  *   events.c  
  *    event framework   *    event framework
  *   *
  *     *  
  *   Author: Serena Willis <jpw@coherent-logic.com>   *   Author: Serena Willis <snw@coherent-logic.com>
  *    Copyright (C) 1998 MUG Deutschland   *    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.   *   This file is part of FreeM.
Line 35 Line 23
  *   You should have received a copy of the GNU Affero Public License   *   You should have received a copy of the GNU Affero Public License
  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.   *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
  *   *
    *   $Log$
    *   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
    *
    *   Revision 1.3  2025/03/09 19:14:24  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 <stdlib.h>  #include <stdlib.h>
Line 257  int evt_get_handlers (char *buf) { Line 258  int evt_get_handlers (char *buf) {
     int ct;             int ct;       
     evt_entry *e;      evt_entry *e;
   
     class_name = malloc (256 * sizeof (char));      class_name = malloc (STRLEN * sizeof (char));
     NULLPTRCHK(class_name,"evt_get_handlers");      NULLPTRCHK(class_name,"evt_get_handlers");
           
     t_buf = malloc (STRLEN * sizeof (char));      t_buf = malloc (STRLEN * sizeof (char));
Line 275  int evt_get_handlers (char *buf) { Line 276  int evt_get_handlers (char *buf) {
     mref_init (r, MREF_RT_SSVN, "^$JOB");      mref_init (r, MREF_RT_SSVN, "^$JOB");
     mref_init (rs, MREF_RT_SSVN, "^$SYSTEM");      mref_init (rs, MREF_RT_SSVN, "^$SYSTEM");
           
     snprintf (pid_s, 9, "%d", pid);      snprintf (pid_s, sizeof (pid_s) - 1, "%d", pid);
           
   
     while ((e = evt_dequeue ()) != NULL) {             while ((e = evt_dequeue ()) != NULL) {       
Line 349  short evt_registered (char *event_id, sh Line 350  short evt_registered (char *event_id, sh
     char pid_s[10];      char pid_s[10];
     int ct;      int ct;
           
     t_key = malloc (256 * sizeof (char));      t_key = malloc (STRLEN * sizeof (char));
     NULLPTRCHK(t_key,"evt_registered");      NULLPTRCHK(t_key,"evt_registered");
           
     class_name = malloc (256 * sizeof (char));      class_name = malloc (STRLEN * sizeof (char));
     NULLPTRCHK(class_name,"evt_registered");      NULLPTRCHK(class_name,"evt_registered");
           
     t_buf = malloc (STRLEN * sizeof (char));      t_buf = malloc (STRLEN * sizeof (char));
Line 370  short evt_registered (char *event_id, sh Line 371  short evt_registered (char *event_id, sh
           
     mref_init (r, MREF_RT_SSVN, "^$JOB");      mref_init (r, MREF_RT_SSVN, "^$JOB");
   
     snprintf (pid_s, 9, "%d", pid);      snprintf (pid_s, sizeof (pid_s) - 1, "%d", pid);
           
     class_name = evt_class_name_c (evt_class);      class_name = evt_class_name_c (evt_class);
   

Removed from v.1.1.1.1  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>