Hi,
As errBuff is an array of pointers, each pointer should have been
allocated memory at run time. First you check for this and then you check
validity of str1 whether is is null or not. If both pointers are not null
only then u perform this strcat.
----- Original Message -----
From: "Syed Najeebullah Hussaini" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Thursday, February 21, 2002 4:22 PM
Subject: RE: problem with StrCat
> Hi Have u checked whether the str1 in ur code contains null value or not.
> This error will occur if a Null String is being accessed.
> debug your program clearly and check for the values its being transferred
to
> str1
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of prasad
> Sent: Thursday, February 21, 2002 3:30 PM
> To: Palm Developer Forum
> Subject: problem with StrCat
>
>
> Hi,
> Here I am getting problem with StrCat(); function
> whenever I am using this Function I am getting the Error
> like
> " Null String passed"
> I am sending tha code here please go through.
>
> I am declare the "errBuff" as global variable
> char *errBuff[50];
> static void MainFormInit()
> {
>
> FormPtr frm;
> ListPtr lst;
> UInt numRecords;
> frm=FrmGetActiveForm();
> numRecords=DmNumRecords(DrugDB);
> int recnum = numRecords/40;
> CharPtr tempStr,test;
> char *test1[50];
> int i,j=0,tempInt,xx=0;
> int xx0=1;
> Handle recHandle1;
> CharPtr recText1,str1;
>
> lst=(ListType
> *)FrmGetObjectPtr(frm,FrmGetObjectIndex(frm,MainUnnamed1001List));
>
> for(i=0;i<recnum;i++)
>
>
>
> file://Retrive information from database
> recHandle1=(char **)DmGetRecord(DrugDB,xx0);
> recText1=(char *)MemHandleLock(recHandle1);
> str1=recText1;
> MemHandleUnlock(recHandle1);
> DmReleaseRecord(DrugDB,xx0, false);
>
> items1[j]=str1;
> StrCopy(errBuff[j],", ");
> StrCat(errBuff[j],str1);
> ErrDisplay(errBuff[j]);
> j=j+1;
> xx0=xx0+40;
> }
> LstSetListChoices(lst,errBuff,recnum);
> LstDrawList(lst);
> }
>
> any one have idea please tell me.
>
>
> -------
>
>
> _____________________________________________________________
> Get Your Free ScanMail and Email At http://www.bharatmail.com
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/