Skip to content

Quick Symbian Factoid #2 : Fix for Des16Align 18 panic.



You would generally get a Des16Align 18 panic when executing a Format function and especially when you are too tired to issue may seem as big as a mountain.
This is caused as the Format function expects a pointer, but when a object is passed by value then the Des16Align panic occurs.

Example code :

       TBuf<64> buf1,buf2,buf3;
        buf1.Copy(_L("C"));        
        buf2.Copy(_L("NewFolder"));
	buf3.Format(_L("%S:\\%S\\"),buf1,buf2); // this is perfect for Des16Align 18 panic.

The correct code would be something like this :

       TBuf<64> buf1,buf2,buf3;
        buf1.Copy(_L("C"));        
        buf2.Copy(_L("NewFolder"));
	buf3.Format(_L("%S:\\%S\\"), &buf1 , &buf2); // this is correct.