Diff for /freem/src/locktab.c between versions 1.5 and 1.6

version 1.5, 2025/03/24 02:57:25 version 1.6, 2025/04/13 04:22:43
Line 24 Line 24
  *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.   *   along with FreeM.  If not, see <https://www.gnu.org/licenses/>.
  *   *
  *   $Log$   *   $Log$
    *   Revision 1.6  2025/04/13 04:22:43  snw
    *   Fix snprintf calls
    *
  *   Revision 1.5  2025/03/24 02:57:25  snw   *   Revision 1.5  2025/03/24 02:57:25  snw
  *   Shared memory compatibility fixes for OS/2   *   Shared memory compatibility fixes for OS/2
  *   *
Line 436  locktab_ent_t *locktab_find(char *key) Line 439  locktab_ent_t *locktab_find(char *key)
     char chk_ns[255];      char chk_ns[255];
   
     if (key[1] == '%') {      if (key[1] == '%') {
         snprintf (chk_ns, 255, "SYSTEM");          snprintf (chk_ns, sizeof (chk_ns) - 1, "SYSTEM");
     }      }
     else {      else {
         snprintf (chk_ns, 255, "%s", nsname);          snprintf (chk_ns, sizeof (chk_ns) - 1, "%s", nsname);
     }      }
   
     for (lck = shm_config->hdr->locktab_head; lck != NULL; lck = lck->next) {      for (lck = shm_config->hdr->locktab_head; lck != NULL; lck = lck->next) {
Line 480  locktab_ent_t *locktab_insert(char *key) Line 483  locktab_ent_t *locktab_insert(char *key)
     ik = internal_to_mref (ik, key);      ik = internal_to_mref (ik, key);
           
     if (key[1] == '%') {      if (key[1] == '%') {
         snprintf (chk_ns, 255, "SYSTEM");          snprintf (chk_ns, sizeof (chk_ns) - 1, "SYSTEM");
     }      }
     else {      else {
         snprintf (chk_ns, 255, "%s", nsname);          snprintf (chk_ns, sizeof (chk_ns) - 1, "%s", nsname);
     }      }
           
     for (l = shm_config->hdr->locktab_head; l != NULL; l = l->next) {      for (l = shm_config->hdr->locktab_head; l != NULL; l = l->next) {
Line 535  new_insert: Line 538  new_insert:
     }      }
   
     stcpy (l->nref, key);      stcpy (l->nref, key);
     snprintf (l->namespace, 255, "%s", chk_ns);      snprintf (l->namespace, sizeof (l->namespace) - 1, "%s", chk_ns);
                   
     l->owner_job = pid;      l->owner_job = pid;
     l->ct = 1;      l->ct = 1;

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


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