From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Wed, 5 Jun 2013 09:06:36 -0400 To: 9fans@9fans.net Message-ID: <5f132c91ca067755129ac7168d8beab1@brasstown.quanstro.net> In-Reply-To: <03dd9a6798effc7cf713d579f6bbc0e6@isd.dp.ua> References: <03dd9a6798effc7cf713d579f6bbc0e6@isd.dp.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] lpdaemon Topicbox-Message-UUID: 632a5f82-ead8-11e9-9d60-3106f5b1d025 i agree ... applied to 9atom. Subject: [sources] applied patch: /n/atom/patch/applied/lpdaemonnit Reply-To: sources@9atom.org email quanstro@quanstro.net readme >From: yaroslav >Subject: [9fans] lpdaemon =09 in /sys/src/cmd/lp/lpdaemon.c:297,310 =09 These info.host[strlen(info.host)] =3D '\0'; =E2=80=A6 info.user[strlen(info.user)] =3D '\0'; =09 look nonsence as zeros are placed exactly where they already are. Should read as in following instead: =09 info.host[NAMELEN] =3D '\0'; =E2=80=A6 info.user[NAMELEN] =3D '\0'; removed =09 files /sys/src/cmd/lp/lpdaemon.c lpdaemon.c /sys/src/cmd/lp/lpdaemon.c lpdaemon.c lpdaemon.c.orig:299,305 - lpdaemon.c:299,305 strncpy(info.host, "unknown", NAMELEN); else strncpy(info.host, (const char *)&ap[1], NAMELEN); - info.host[strlen(info.host)] =3D '\0'; + info.host[NAMELEN] =3D '\0'; break; case 'P': if (ap[1] =3D=3D '\0') lpdaemon.c.orig:306,312 - lpdaemon.c:306,312 strncpy(info.user, "unknown", NAMELEN); else strncpy(info.user, (const char *)&ap[1], NAMELEN); - info.user[strlen(info.user)] =3D '\0'; + info.user[NAMELEN] =3D '\0'; break; } } ------ merge...backup...copy... cpfile lpdaemon.c /n/dist/sys/src/cmd/lp/lpdaemon.c # remove these files if you want. I will not remove them for you # ($patch/undo will not restore them) done