On Thu, Aug 9, 2012 at 1:22 PM, Douglas Mencken <dougmenc...@gmail.com> wrote:
>> sizeof of a string literal
>> should give the number of bytes in it [which is a really
>> weird special case of C, see
>> http://en.wikipedia.org/wiki/Sizeof#Using_sizeof_with_arrays]
>
> Watch it:
>
> char* test1 = (char*)malloc(1000);
> char test2[] = "tezzzzzzt";
> printf("sizeof(test1) = %d, sizeof(test2) = %d\n", sizeof(test1),
> sizeof(test2));
>
> sizeof(test1) = 4, sizeof(test2) = 10
>
Exactly! And both _DTDTSMMTEMPFILE and _DTDTSMMTEMPDIR are
#defined as string literals (without any char* casts or the like), which means
that the latter and correct behavior is used (if you are unsure, just change
your example to use the string literal directly).

>> error: patch failed: cde/lib/DtSvc/DtUtil1/DtsMM.c:567
>> error: cde/lib/DtSvc/DtUtil1/DtsMM.c: patch does not apply
>
> Why don't you used my version, with snprintf, made against git HEAD,
> attached to letter, etc.?

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel

Reply via email to