Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55241475.5070006@mailbox.org>
Date: Tue, 07 Apr 2015 19:31:33 +0200
From: Frank Dittrich <frank.dittrich@...lbox.org>
To: john-dev@...ts.openwall.com
Subject: Re: Coding Style

On 04/07/2015 07:04 PM, magnum wrote:
> On 2015-04-07 18:56, Frank Dittrich wrote:
>> Regarding line size: I can easily live with 132. 80 is better if you
>> want to print longer source codes on paper for some reason.
>> Please avoid splitting stdout or stderr strings to reduce the line size.
>> It makes  grepping just too error prone.
> 
> You mean things like this?
> 
>             if (john_main_process)
>                     fprintf(stderr, "%s%d password hash%s cracked,"
>                             " %d left\n", total ? "\n" : "", total,
>                             total != 1 ? "es" : "", db->password_count);
> 

This example isn't that much of a problem, since you would have to grep
got either %d, %u or %lu etc, and probably not expect "hash%s", etc.
May be I would move the space from the start of the second string to the
end of the first...

I was more afraid of string that currently allow easy grepping, but
wouldn't if you break these strings in the wrong position.

This example (among several others) is worse (common-opencl.c):
				fprintf(stderr, "Hardware resources "
					"exhausted\n");

It also uses tab for "alignment".

Frank

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.