Re: SEGV when replying to mail.



On 2001.08.26 18:17 Carlos Morgado wrote:
>On Sun, Aug 26, 2001 at 07:28:51PM +0200, M . Thielker wrote:
>
>>  
>> @@ -249,7 +248,10 @@
>>      body->encoding = encoding_style;
>>      body->parameter = mutt_new_parameter();
>>      body->parameter->attribute = g_strdup("charset");
>> +	if (charset)
>>      body->parameter->value = g_strdup(charset);
>> +	else
>> +		body->parameter->value = g_strdup("us-ascii");
>>      body->parameter->next = NULL;
>>  
>
>reasonable. but why keep "us-ascii" as default ? i like iso-8859-1
>much better ;)
>peeve ;)

I agree--but why should some libmutt code decide what the default should
be? Returning a NULL pointer for a `not found' case is fine, as is
returning -1 for a `not found' array entry--just make sure that you
don't test a pointer >= 0 (always true!) or an unsigned int < 0 (always
false!).

Low-level code should make low-level decisions--like `is this charset in
the list'? Leave the action for when it's not found to higher-level (=
more visible) code.

Just my $0.02 worth!

Peter




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]