IN6_IS_ADDR_MC_LINKLOCAL(in6)) {
/* XXX: override is ok? */
sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short *)&in6->s6_addr[2]);
IN6_IS_ADDR_MC_LINKLOCAL(in6)) {
/* XXX: override is ok? */
sa6->sin6_scope_id = (u_int32_t)ntohs(*(u_short *)&in6->s6_addr[2]);
- (void) sprintf(workbuf, "link#%d", sdl->sdl_index);
+ (void) snprintf(workbuf, sizeof(workbuf), "link#%d", sdl->sdl_index);
- cp += sprintf(cp, "%s%x", cplim, *lla);
+ cp += snprintf(cp, sizeof(workbuf) - (cp - workbuf), "%s%x", cplim, *lla);
- cp += sprintf(cp, "(%d)", sa->sa_family);
+ cp += snprintf(cp, sizeof(workbuf) - (cp - workbuf), "(%d)", sa->sa_family);
- cp += sprintf(cp, " %02x", *s++);
+ cp += snprintf(cp, sizeof(workbuf) - (cp - workbuf), " %02x", *s++);
- cp += sprintf(cp, "%02x", *s++);
+ cp += snprintf(cp, sizeof(workbuf) - (cp - workbuf), "%02x", *s++);
C(in >> 24), C(in >> 16), C(in >> 8), C(in));
}
return (line);
C(in >> 24), C(in >> 16), C(in >> 8), C(in));
}
return (line);
C(i >> 24), C(i >> 16), C(i >> 8), C(i));
break;
}
C(i >> 24), C(i >> 16), C(i >> 8), C(i));
break;
}
- sprintf(&line[strlen(line)], "/%d", masklen);
+ snprintf(&line[strlen(line)], sizeof(line) - strlen(line), "/%d", masklen);