This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] cygcheck: pretty_id misbehaving.


Op Sun, 17 Oct 2004 19:34:23 -0400 schreef Christopher Faylor
in <20041017233423.GA8780@trixie.casa.cgf.cx>:
:  On Sat, Oct 16, 2004 at 02:14:33AM +0200, Bas van Gompel wrote:
: > Op Fri, 15 Oct 2004 09:59:04 -0400 schreef Christopher Faylor
: > jj:  or to negate
: > :  sz repeatedly inside of a loop.
: >
: > My plan was to not negate sz at all, use the printf format-flag ``-''.
:
:   Yes.  I get it.  This is a difference of opinion.

Oh well, it works.

: > Also, space needs to be allocated for the trailing `\0` on uid and
: > gid, and notice there isn't a space at the end of the printf format.
:
:   I keep making this stupid mistake.  I have, again, checked in a variation
:  of your fix.  I think I got it right this time.

Well, almost. :)


ChangeLog-entry:

2004-10-18  Bas van Gompel  <cygwin-patch.buzz@bavag.tmfweb.nl>

	* Cygcheck.cc (pretty_id): Count ')' in ui_len and gui_len.


--- src/winsup/utils-3/cygcheck.cc	17 Oct 2004 23:31:23 -0000	1.51
+++ src/winsup/utils-3/cygcheck.cc	18 Oct 2004 01:20:27 -0000
@@ -814,8 +814,8 @@ pretty_id (const char *s, char *cygwin, 
     }
 
   char **ng = groups - 1;
-  size_t len_uid = strlen ("UID: ") + strlen (uid);
-  size_t len_gid = strlen ("GID: ") + strlen (gid);
+  size_t len_uid = strlen ("UID: )") + strlen (uid);
+  size_t len_gid = strlen ("GID: )") + strlen (gid);
   *++ng = groups[0] = (char *) alloca (len_uid + 1);
   *++ng = groups[1] = (char *) alloca (len_gid + 1);
   sprintf (groups[0], "UID: %s)", uid);


L8r,

Buzz.
-- 
  ) |  | ---/ ---/  Yes, this | This message consists of true | I do not
--  |  |   /    /   really is |   and false bits entirely.    | mail for
  ) |  |  /    /    a 72 by 4 +-------------------------------+ any1 but
--  \--| /--- /---  .sigfile. |   |perl -pe "s.u(z)\1.as."    | me. 4^re


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]