Do not modify a malloc()ed pointer; instead, use memmove().

Detected by: phkmalloc - AJ :)
This commit is contained in:
Joerg Wunsch 1996-10-28 23:02:38 +00:00
parent c2b3cc824d
commit d4788da623

View File

@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
/* from: @(#)inetd.c 8.4 (Berkeley) 4/13/94"; */
static char inetd_c_rcsid[] =
"$Id: inetd.c,v 1.12 1996/07/17 15:00:28 davidg Exp $";
"$Id: inetd.c,v 1.13 1996/08/09 22:20:24 julian Exp $";
#endif /* not lint */
/*
@ -926,7 +926,8 @@ getconfigent()
sep->se_socktype = -1;
sep->se_proto = newstr(sskip(&cp));
if (strncmp(sep->se_proto, "rpc/", 4) == 0) {
sep->se_proto += 4;
memmove(sep->se_proto, sep->se_proto + 4,
strlen(sep->se_proto) + 1 - 4);
sep->se_rpc = 1;
sep->se_rpc_prog = sep->se_rpc_lowvers =
sep->se_rpc_lowvers = 0;