9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] lpdaemon
Date: Wed,  5 Jun 2013 09:06:36 -0400	[thread overview]
Message-ID: <5f132c91ca067755129ac7168d8beab1@brasstown.quanstro.net> (raw)
In-Reply-To: <03dd9a6798effc7cf713d579f6bbc0e6@isd.dp.ua>

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 <yarikos@gmail.com>
	>Subject: [9fans] lpdaemon
	
	in /sys/src/cmd/lp/lpdaemon.c:297,310
	
	These
				info.host[strlen(info.host)] = '\0';
				…
				info.user[strlen(info.user)] = '\0';
	
	look nonsence as zeros are placed exactly where they already are.
	Should read as in following instead:
	
				info.host[NAMELEN] = '\0';
				…
				info.user[NAMELEN] = '\0';
removed
	
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)] = '\0';
+ 			info.host[NAMELEN] = '\0';
  			break;
  		case 'P':
  			if (ap[1] == '\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)] = '\0';
+ 			info.user[NAMELEN] = '\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



  reply	other threads:[~2013-06-05 13:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-05 11:38 yaroslav
2013-06-05 13:06 ` erik quanstrom [this message]
2013-06-05 13:13 ` Don Bailey
2013-06-05 13:20   ` erik quanstrom
2013-06-05 13:40     ` Don Bailey
2013-06-05 13:38   ` Friedrich Psiorz
2013-06-05 13:54     ` Don Bailey
2013-06-05 14:09       ` erik quanstrom
2013-06-05 14:29         ` Don Bailey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f132c91ca067755129ac7168d8beab1@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).