[26252] in Source-Commits
Re: /svn/athena r25472 - in trunk/third/moira: clients/mailmaint clients/moira clients/mrcheck clients/mrtest debian lib update
daemon@ATHENA.MIT.EDU (Jonathan Reed)
Thu May 3 16:05:30 2012
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Jonathan Reed <jdreed@MIT.EDU>
In-Reply-To: <4FA2E397.1050208@mit.edu>
Date: Thu, 3 May 2012 16:05:28 -0400
Cc: Geoffrey Thomas <geofft@MIT.EDU>, source-commits@MIT.EDU
Message-Id: <1F2ED255-1893-432A-9226-7F590A12DCA8@mit.edu>
To: Greg Hudson <ghudson@MIT.EDU>
Content-Transfer-Encoding: 8bit
On May 3, 2012, at 3:59 PM, Greg Hudson wrote:
> On 05/03/2012 03:55 PM, Jonathan Reed wrote:
>> I'm not sure what you're objecting to, or what your alternative suggesting for fixing the error is. I may well be wrong, but this is unclear.
>
> I will translate from C nerd.
>
>>>> - com_err(program_name, status, "\nPress [RETURN] to continue");
>>>> + com_err(program_name, status, "%s", "\nPress [RETURN] to continue");
>>> Huh?
>
> "This is a literal string. You shouldn't need to change it, should you?"
Indeed not. And it works as originally written. I must have misread a line number or something. I will revert it.
>
>>>> sprintf(input, "Cannot open input file %s", argv[1]);
>>>> - com_err("moira (script)", 0, input);
>>>> + com_err("moira (script)", 0, "%s", input);
>>> This seems a little redundant...
>
> "Wouldn't it be better to eliminate the snprintf() call by bringing its
> format string down into the com_err() call?"
Probably. I assume no one can think of a reason why it wasn't just written that way in the first place? My goal here was to make it build, not necessarily to fix other inefficiencies, but I suppose there's no reason I can't do both.
-Jon