Jim Tcl
Diff
Not logged in

Differences From Artifact [ceca032601f4821d]:

To Artifact [2f50ac333b8897e3]:


248 248 return ret; 249 249 } 250 250 251 251 #ifdef HAVE_SYS_UN_H 252 252 static int JimParseDomainAddress(Jim_Interp *interp, const char *path, struct sockaddr_un *sa) 253 253 { 254 254 sa->sun_family = PF_UNIX; 255 - strcpy(sa->sun_path, path); 255 + snprintf(sa->sun_path, sizeof(sa->sun_path), "%s", path); 256 256 257 257 return JIM_OK; 258 258 } 259 259 #endif 260 260 #endif 261 261 262 262 static void JimAioSetError(Jim_Interp *interp, Jim_Obj *name) ................................................................................ 604 604 #ifdef O_NDELAY 605 605 af->flags = fcntl(af->fd, F_GETFL); 606 606 #endif 607 607 af->rEvent = NULL; 608 608 af->wEvent = NULL; 609 609 af->eEvent = NULL; 610 610 af->addr_family = serv_af->addr_family; 611 - sprintf(buf, "aio.sockstream%ld", Jim_GetId(interp)); 611 + snprintf(buf, sizeof(buf), "aio.sockstream%ld", Jim_GetId(interp)); 612 612 Jim_CreateCommand(interp, buf, JimAioSubCmdProc, af, JimAioDelProc); 613 613 Jim_SetResultString(interp, buf, -1); 614 614 return JIM_OK; 615 615 } 616 616 617 617 #endif 618 618 ................................................................................ 945 945 #endif 946 946 fp = fopen(filename, mode); 947 947 if (fp == NULL) { 948 948 JimAioSetError(interp, argv[1]); 949 949 return JIM_ERR; 950 950 } 951 951 /* Get the next file id */ 952 - sprintf(buf, "aio.handle%ld", Jim_GetId(interp)); 952 + snprintf(buf, sizeof(buf), "aio.handle%ld", Jim_GetId(interp)); 953 953 cmdname = buf; 954 954 } 955 955 956 956 /* Create the file command */ 957 957 af = Jim_Alloc(sizeof(*af)); 958 958 af->fp = fp; 959 959 af->fd = fileno(fp);