ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/send.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/send.c (file contents):
Revision 1844 by michael, Mon Apr 22 15:35:39 2013 UTC vs.
Revision 2518 by michael, Sun Oct 27 19:41:30 2013 UTC

# Line 362 | Line 362 | sendto_channel_butone(struct Client *one
362    dlink_node *ptr = NULL, *ptr_next = NULL;
363  
364    if (IsServer(from))
365 <    local_len = sprintf(local_buf, ":%s ",
365 >    local_len = snprintf(local_buf, sizeof(local_buf), ":%s ",
366                          from->name);
367    else
368 <    local_len = sprintf(local_buf, ":%s!%s@%s ",
369 <                        from->name, from->username, from->host);
370 <  remote_len = sprintf(remote_buf, ":%s ",
371 <                          from->name);
372 <  uid_len = sprintf(uid_buf, ":%s ",
373 <                    ID(from));
368 >    local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ",
369 >                         from->name, from->username, from->host);
370 >  remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ",
371 >                        from->name);
372 >  uid_len = snprintf(uid_buf, sizeof(uid_buf), ":%s ", ID(from));
373  
374    va_start(alocal, pattern);
375    va_start(aremote, pattern);
# Line 717 | Line 716 | sendto_match_butone(struct Client *one,
716    struct Client *client_p;
717    dlink_node *ptr, *ptr_next;
718    char local_buf[IRCD_BUFSIZE], remote_buf[IRCD_BUFSIZE];
719 <  int local_len = sprintf(local_buf, ":%s!%s@%s ", from->name,
720 <                          from->username, from->host);
721 <  int remote_len = sprintf(remote_buf, ":%s ", from->name);
719 >  int local_len = snprintf(local_buf, sizeof(local_buf), ":%s!%s@%s ",
720 >                           from->name, from->username, from->host);
721 >  int remote_len = snprintf(remote_buf, sizeof(remote_buf), ":%s ",
722 >                            from->name);
723  
724    va_start(alocal, pattern);
725    va_start(aremote, pattern);
# Line 853 | Line 853 | sendto_anywhere(struct Client *to, struc
853      if (IsServer(from))
854      {
855        if (IsCapable(to, CAP_TS6) && HasID(from))
856 <        len = sprintf(buffer, ":%s ", from->id);
856 >        len = snprintf(buffer, sizeof(buffer), ":%s ", from->id);
857        else
858 <        len = sprintf(buffer, ":%s ", from->name);
858 >        len = snprintf(buffer, sizeof(buffer), ":%s ", from->name);
859      }
860      else
861 <      len = sprintf(buffer, ":%s!%s@%s ",
862 <                       from->name, from->username, from->host);
861 >      len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s ",
862 >                     from->name, from->username, from->host);
863    }
864 <  else len = sprintf(buffer, ":%s ", ID_or_name(from, send_to));
864 >  else len = snprintf(buffer, sizeof(buffer), ":%s ", ID_or_name(from, send_to));
865  
866    va_start(args, pattern);
867    len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args);
868    va_end(args);
869  
870 <  if(MyClient(to))
870 >  if (MyClient(to))
871      send_message(send_to, buffer, len);
872    else
873      send_message_remote(send_to, from, buffer, len);
# Line 945 | Line 945 | sendto_wallops_flags(unsigned int flags,
945    int len;
946  
947    if (IsClient(source_p))
948 <    len = sprintf(buffer, ":%s!%s@%s WALLOPS :",
949 <                  source_p->name, source_p->username, source_p->host);
948 >    len = snprintf(buffer, sizeof(buffer), ":%s!%s@%s WALLOPS :",
949 >                   source_p->name, source_p->username,
950 >                   source_p->host);
951    else
952 <    len = sprintf(buffer, ":%s WALLOPS :", source_p->name);
952 >    len = snprintf(buffer, sizeof(buffer), ":%s WALLOPS :",
953 >                   source_p->name);
954  
955    va_start(args, pattern);
956    len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args);
# Line 1026 | Line 1028 | kill_client(struct Client *client_p, str
1028    if (IsDead(client_p))
1029      return;
1030  
1031 <  len = sprintf(buffer, ":%s KILL %s :", ID_or_name(&me, client_p->from),
1032 <                ID_or_name(diedie, client_p));
1031 >  len = snprintf(buffer, sizeof(buffer), ":%s KILL %s :",
1032 >                 ID_or_name(&me, client_p->from),
1033 >                 ID_or_name(diedie, client_p));
1034  
1035    va_start(args, pattern);
1036    len += send_format(&buffer[len], IRCD_BUFSIZE - len, pattern, args);
# Line 1060 | Line 1063 | kill_client_ll_serv_butone(struct Client
1063    {
1064      have_uid = 1;
1065      va_start(args, pattern);
1066 <    len_uid = sprintf(buf_uid, ":%s KILL %s :", me.id, ID(source_p));
1066 >    len_uid = snprintf(buf_uid, sizeof(buf_uid), ":%s KILL %s :",
1067 >                       me.id, ID(source_p));
1068      len_uid += send_format(&buf_uid[len_uid], IRCD_BUFSIZE - len_uid, pattern,
1069                             args);
1070      va_end(args);
1071    }
1072  
1073    va_start(args, pattern);
1074 <  len_nick = sprintf(buf_nick, ":%s KILL %s :", me.name, source_p->name);
1074 >  len_nick = snprintf(buf_nick, sizeof(buf_nick), ":%s KILL %s :",
1075 >                      me.name, source_p->name);
1076    len_nick += send_format(&buf_nick[len_nick], IRCD_BUFSIZE - len_nick, pattern,
1077                            args);
1078    va_end(args);

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)