Changeset 1151f0b


Ignore:
Timestamp:
Jan 10, 2008, 1:28:59 AM (13 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
9506feb
Parents:
44f32fb
Message:
sprintf -> snprintf
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r44f32fb r1151f0b  
    563563    }
    564564  } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) {
     565    #define BUFFLEN 1024
    565566    if (retnotice->z_recipient == NULL
    566567        || *retnotice->z_recipient == NULL
    567568        || *retnotice->z_recipient == '@') {
    568       char buff[1024];
     569      char buff[BUFFLEN];
    569570      owl_function_error("No one subscribed to class %s", retnotice->z_class);
    570       sprintf(buff, "Could not send message to class %s: no one subscribed.\n", retnotice->z_class);
     571      snprintf(buff, BUFFLEN, "Could not send message to class %s: no one subscribed.\n", retnotice->z_class);
    571572      owl_function_adminmsg("", buff);
    572573    } else {
    573       char buff[1024];
     574      char buff[BUFFLEN];
    574575      tmp = short_zuser(retnotice->z_recipient);
    575576      owl_function_error("%s: Not logged in or subscribing.", tmp);
    576       sprintf(buff, "Could not send message to %s: not logged in or subscribing to", tmp);
     577      snprintf(buff, BUFFLEN, "Could not send message to %s: not logged in or subscribing to", tmp);
    577578      if(strcmp(retnotice->z_class, "message")) {
    578         sprintf(buff, "%s class %s, instance %s.\n", buff,
    579                 retnotice->z_class,
    580                 retnotice->z_class_inst);
     579        snprintf(buff, BUFFLEN,
     580                 "%s class %s, instance %s.\n", buff,
     581                 retnotice->z_class,
     582                 retnotice->z_class_inst);
    581583      } else {
    582         sprintf(buff, "%s messages.\n", buff);
     584        snprintf(buff, BUFFLEN,
     585                 "%s messages.\n", buff);
    583586      }
    584587      owl_function_adminmsg("", buff);
Note: See TracChangeset for help on using the changeset viewer.