Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -uN asl-current/a2k.c asl-newest/a2k.c
- --- asl-current/a2k.c 1997-11-18 05:25:55.000000000 -0200
- +++ asl-newest/a2k.c 2013-12-18 21:08:58.207284813 -0200
- @@ -73,7 +73,7 @@
- if (BUFFERSIZE==BufferFill)
- {
- fprintf(outfile,"%s\n",lines[0]);
- - for (z=0; z<BufferFill; z++) strcpy(lines[z],lines[z+1]);
- + for (z=0; z<BufferFill; z++) custom_string_copy(lines[z],lines[z+1]);
- BufferFill--;
- }
- readline(inpfile,lines[BufferFill++]);
- @@ -103,7 +103,7 @@
- /* cut function name+prefixes: parameter list starts at first '(' */
- p=strchr(orig,'('); *p='\0';
- - sprintf(dest,"\t%s",orig); strcat(dest,"("); strcpy(orig,p+1);
- + sprintf(dest,"\t%s",orig); strcat(dest,"("); custom_string_copy(orig,p+1);
- /* cut trailing ')' */
- @@ -117,15 +117,15 @@
- p=strchr(orig,',');
- if (p==NULL)
- {
- - strcpy(single,orig); *orig='\0';
- + custom_string_copy(single,orig); *orig='\0';
- }
- else
- {
- - *p='\0'; strcpy(single,orig); strcpy(orig,p+1);
- + *p='\0'; custom_string_copy(single,orig); custom_string_copy(orig,p+1);
- }
- - for (p=single; isspace(*p); p++); strcpy(single,p);
- + for (p=single; isspace(*p); p++); custom_string_copy(single,p);
- for (p=single+strlen(single)-1; isspace(*p); p--); p[1]='\0';
- - if (strncmp(single,"const ",6)==0) strcpy(single,single+6);
- + if (strncmp(single,"const ",6)==0) custom_string_copy(single,single+6);
- if (strcmp(single,"void")!=0)
- {
- strcat(params,single); strcat(params,";\n");
- @@ -169,7 +169,7 @@
- flush line buffer before. */
- save=p[1];
- - p[1]='\0'; strcpy(dest,lines[BufferFill-1]); strcat(dest,");");
- + p[1]='\0'; custom_string_copy(dest,lines[BufferFill-1]); strcat(dest,");");
- p[1]=save;
- for (z=0; z<BufferFill-1; fprintf(outfile,"%s\n",lines[z++]));
- @@ -177,7 +177,7 @@
- /* discard lines until end of prototype */
- - strcpy(dest,lines[BufferFill-1]); BufferFill=0;
- + custom_string_copy(dest,lines[BufferFill-1]); BufferFill=0;
- while (strcmp(dest+strlen(dest)-2,");")!=0)
- {
- readline(inpfile,dest);
- diff -uN asl-current/as.c asl-newest/as.c
- --- asl-current/as.c 2013-03-09 13:15:07.000000000 -0300
- +++ asl-newest/as.c 2013-12-18 21:11:20.131290696 -0200
- @@ -77,7 +77,7 @@
- * - add some platforms
- *
- * Revision 1.22 2010/04/17 13:14:18 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.21 2010/02/27 14:17:26 alfred
- * - correct increment/decrement of macro nesting level
- @@ -717,7 +717,7 @@
- Lauf = PInp->Lines;
- for (z = 1; z <= PInp->LineZ - 1; z++)
- Lauf = Lauf->Next;
- - strcpy(erg, Lauf->Content);
- + custom_string_copy(erg, Lauf->Content);
- /* process parameters */
- @@ -1140,7 +1140,7 @@
- /* extract line */
- - strcpy(erg, PInp->LineRun->Content);
- + custom_string_copy(erg, PInp->LineRun->Content);
- PInp->LineRun = PInp->LineRun->Next;
- /* expand iteration parameter */
- @@ -1404,7 +1404,7 @@
- /* extract line */
- - strcpy(erg, PInp->LineRun->Content);
- + custom_string_copy(erg, PInp->LineRun->Content);
- PInp->LineRun = PInp->LineRun->Next;
- /* extract iteration parameter */
- @@ -1577,7 +1577,7 @@
- /* extract line */
- - strcpy(erg, PInp->LineRun->Content);
- + custom_string_copy(erg, PInp->LineRun->Content);
- PInp->LineRun = PInp->LineRun->Next;
- /* last line of body? Then increment count and stop if last iteration */
- @@ -1777,7 +1777,7 @@
- {
- /* get line of body */
- - strcpy(erg, PInp->LineRun->Content);
- + custom_string_copy(erg, PInp->LineRun->Content);
- PInp->LineRun = PInp->LineRun->Next;
- /* in case this is the last line of the body, reset counters */
- @@ -2134,7 +2134,7 @@
- {
- Last = RunTag->GetPos(RunTag, ActPos);
- tmppos = (char *) malloc(strlen(ErgPos) + strlen(ActPos) + 1);
- - strcpy(tmppos, ActPos); strcat(tmppos, ErgPos);
- + custom_string_copy(tmppos, ActPos); strcat(tmppos, ErgPos);
- free(ErgPos); ErgPos = tmppos;
- if (Last) break;
- }
- @@ -2239,7 +2239,7 @@
- BEGIN
- SearchMacros=True; ExpandSymbol(OpPart);
- END
- - strcpy(LOpPart,OpPart); NLS_UpString(OpPart);
- + custom_string_copy(LOpPart,OpPart); NLS_UpString(OpPart);
- /* Prozessor eingehaengt ? */
- @@ -2423,7 +2423,7 @@
- strmaxcpy(h,OneLine,255); i=QuotPos(h,';');
- if (i!=Nil)
- BEGIN
- - strcpy(CommPart,i+1);
- + custom_string_copy(CommPart,i+1);
- *i='\0';
- END
- else *CommPart='\0';
- @@ -2441,11 +2441,11 @@
- break;
- if (!*i)
- {
- - strcpy(LabPart, h); *h = '\0';
- + custom_string_copy(LabPart, h); *h = '\0';
- }
- else
- {
- - *i = '\0'; strcpy(LabPart, h); strmov(h, i + 1);
- + *i = '\0'; custom_string_copy(LabPart, h); strmov(h, i + 1);
- }
- if (LabPart[l = (strlen(LabPart) - 1)] == ':')
- LabPart[l] = '\0';
- @@ -2465,10 +2465,10 @@
- i=strchr(OpPart,':');
- if ((*LabPart=='\0') AND (i!=Nil) AND (i[1]=='\0'))
- BEGIN
- - *i='\0'; strcpy(LabPart,OpPart); strcpy(OpPart,i+1);
- + *i='\0'; custom_string_copy(LabPart,OpPart); custom_string_copy(OpPart,i+1);
- if (*OpPart=='\0')
- BEGIN
- - strcpy(h,ArgPart);
- + custom_string_copy(h,ArgPart);
- longjmp(Retry,1);
- END
- END
- @@ -2500,7 +2500,7 @@
- /* Argumente zerteilen: Da alles aus einem String kommt und die Teile alle auch
- so lang sind, koennen wir uns Laengenabfragen sparen */
- - ArgCnt=0; strcpy(h,ArgPart); run=h;
- + ArgCnt=0; custom_string_copy(h,ArgPart); run=h;
- if (*run!='\0')
- do
- BEGIN
- @@ -2513,7 +2513,7 @@
- END
- lpos=((i!=Nil) AND (i[1]=='\0'));
- if (i!=Nil) *i='\0';
- - strcpy(ArgStr[++ArgCnt],run);
- + custom_string_copy(ArgStr[++ArgCnt],run);
- if ((lpos) AND (ArgCnt!=ParMax)) *ArgStr[++ArgCnt]='\0';
- KillPostBlanks(ArgStr[ArgCnt]);
- run=(i==Nil) ? i : i+1;
- @@ -3093,20 +3093,20 @@
- WrLstLine("");
- END
- - strcpy(s,Dec32BlankString(LineSum,7));
- + custom_string_copy(s,Dec32BlankString(LineSum,7));
- strmaxcat(s,getmessage((LineSum==1)?Num_InfoMessAssLine:Num_InfoMessAssLines),255);
- if (NOT QuietMode) printf("%s%s\n",s,ClrEol);
- if (ListMode==2) WrLstLine(s);
- if (LineSum!=MacLineSum)
- BEGIN
- - strcpy(s,Dec32BlankString(MacLineSum,7));
- + custom_string_copy(s,Dec32BlankString(MacLineSum,7));
- strmaxcat(s,getmessage((MacLineSum==1)?Num_InfoMessMacAssLine:Num_InfoMessMacAssLines),255);
- if (NOT QuietMode) printf("%s%s\n",s,ClrEol);
- if (ListMode==2) WrLstLine(s);
- END
- - strcpy(s,Dec32BlankString(PassNo,7));
- + custom_string_copy(s,Dec32BlankString(PassNo,7));
- strmaxcat(s,getmessage((PassNo==1)?Num_InfoMessPassCnt:Num_InfoMessPPassCnt),255);
- if (NOT QuietMode) printf("%s%s\n",s,ClrEol);
- if (ListMode==2) WrLstLine(s);
- @@ -3492,7 +3492,7 @@
- END
- else
- BEGIN
- - *p='\0'; strmaxcpy(Part,Copy,255); strcpy(Copy,p+1);
- + *p='\0'; strmaxcpy(Part,Copy,255); custom_string_copy(Copy,p+1);
- END
- if (NOT CaseSensitive)
- UpString(Part);
- @@ -3503,7 +3503,7 @@
- END
- else
- BEGIN
- - *p='\0'; strmaxcpy(Name,Part,255); strcpy(Part,p+1);
- + *p='\0'; strmaxcpy(Name,Part,255); custom_string_copy(Part,p+1);
- END
- if (NOT ChkSymbName(Name)) return CMDErr;
- if (Negate) RemoveDefSymbol(Name);
- @@ -3843,8 +3843,8 @@
- END
- else
- BEGIN
- - strcpy(ClrEol," [K"); ClrEol[0]=Char_ESC; /* ANSI-Sequenzen */
- - strcpy(CursUp," [A"); CursUp[0]=Char_ESC;
- + custom_string_copy(ClrEol," [K"); ClrEol[0]=Char_ESC; /* ANSI-Sequenzen */
- + custom_string_copy(CursUp," [A"); CursUp[0]=Char_ESC;
- END
- break;
- case RedirToDevice:
- @@ -3853,7 +3853,7 @@
- for (i=1; i<=20; i++) strcat(ClrEol,"\b");
- break;
- case RedirToFile:
- - strcpy(ClrEol,"\n"); /* CRLF auf Datei */
- + custom_string_copy(ClrEol,"\n"); /* CRLF auf Datei */
- END
- ShareMode = 0; ListMode = 0; IncludeList[0] = '\0'; SuppWarns = False;
- @@ -3861,7 +3861,7 @@
- MakeIncludeList = False; ListMask = 0x1ff;
- MakeDebug = False; ExtendErrors = 0;
- MacroOutput = False; MacProOutput = False; CodeOutput = True;
- - strcpy(ErrorPath, "!2"); MsgIfRepass = False; QuietMode = False;
- + custom_string_copy(ErrorPath, "!2"); MsgIfRepass = False; QuietMode = False;
- NumericErrors = False; DebugMode = DebugNone; CaseSensitive = False;
- ThrowErrors = False; HardRanges = True;
- NoICEMask = 1 << SegCode;
- @@ -3896,7 +3896,7 @@
- GlobErrFlag=False;
- if (ErrorPath[0]!='\0')
- BEGIN
- - strcpy(ErrorName,ErrorPath);
- + custom_string_copy(ErrorName,ErrorPath);
- unlink(ErrorName);
- END
- IsErrorOpen=False;
- diff -uN asl-current/asmallg.c asl-newest/asmallg.c
- --- asl-current/asmallg.c 2012-05-26 10:49:19.000000000 -0300
- +++ asl-newest/asmallg.c 2013-12-18 21:08:58.215284813 -0200
- @@ -35,10 +35,10 @@
- * - regard symbol name expansion in arguments for SHARED
- *
- * Revision 1.9 2010/08/27 14:52:41 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.8 2010/04/17 13:14:19 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.7 2008/11/23 10:39:15 alfred
- * - allow strings with NUL characters
- diff -uN asl-current/asmif.c asl-newest/asmif.c
- --- asl-current/asmif.c 2010-08-27 11:52:41.000000000 -0300
- +++ asl-newest/asmif.c 2013-12-18 21:08:58.219284813 -0200
- @@ -11,7 +11,7 @@
- /*****************************************************************************
- * $Log: asmif.c,v $
- * Revision 1.4 2010/08/27 14:52:41 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.3 2008/11/23 10:39:15 alfred
- * - allow strings with NUL characters
- diff -uN asl-current/asmpars.c asl-newest/asmpars.c
- --- asl-current/asmpars.c 2013-03-09 13:15:08.000000000 -0300
- +++ asl-newest/asmpars.c 2013-12-18 21:08:58.223284813 -0200
- @@ -43,7 +43,7 @@
- * - add NEC 75xx
- *
- * Revision 1.19 2010/04/17 13:14:19 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.18 2010/03/07 11:16:53 alfred
- * - allow DC.(float) on string operands
- @@ -499,7 +499,7 @@
- while (p!=Nil)
- BEGIN
- n=p+1; if (ProcessBk(&n,&ErgChar)) *p=ErgChar;
- - strcpy(p+1,n);
- + custom_string_copy(p+1,n);
- p=strchr(p+1,'\\');
- END
- END
- @@ -520,7 +520,7 @@
- WrXError(1020,Name);
- return False;
- END
- - strcpy(p1,p2+1); *p2='\0';
- + custom_string_copy(p1,p2+1); *p2='\0';
- FirstPassUnknown=False;
- EvalStringExpression(h,&OK,h);
- if (FirstPassUnknown)
- @@ -584,7 +584,7 @@
- if (*TmpSymCounterVal == '\0')
- sprintf(TmpSymCounterVal, "%d", TmpSymCounter);
- - strcpy(Dest, TmpSymCounterVal);
- + custom_string_copy(Dest, TmpSymCounterVal);
- Result = TRUE;
- }
- @@ -1899,7 +1899,17 @@
- if (!KlPos)
- Copy[0] = '\0';
- else
- - strcpy(Copy, KlPos + 1);
- + {
- + const size_t copyLen = strlen(KlPos+1) + 1;
- + char* buffer = malloc(copyLen);
- + memset(buffer, 0, copyLen);
- + strcpy(buffer, KlPos+1);
- +
- + custom_string_copy(Copy, buffer);
- +
- + free (buffer);
- + // custom_string_copy(Copy, KlPos + 1); // overlap here
- + }
- strmaxcpy(stemp, "(", 255);
- switch (LVal.Typ)
- @@ -4156,7 +4166,7 @@
- if (SymbolEntry->RefList==Nil) return;
- ConvertSymbolVal(&(SymbolEntry->SymWert),&t);
- - strcpy(h," (=");
- + custom_string_copy(h," (=");
- StrSym(&t, False, h2, sizeof(h2));
- strmaxcat(h,h2,255);
- strmaxcat(h,",",255);
- @@ -4183,12 +4193,12 @@
- if (Lauf!=Nil)
- {
- - strcpy(h," ");
- + custom_string_copy(h," ");
- strmaxcat(h,getmessage(Num_ListCrossFileName),255);
- strmaxcat(h,GetFileName(FileZ),255);
- strmaxcat(h," :",255);
- WrLstLine(h);
- - strcpy(LineAcc," ");
- + custom_string_copy(LineAcc," ");
- while (Lauf!=Nil)
- {
- sprintf(LinePart,"%5ld", (long)Lauf->LineNum);
- @@ -4201,7 +4211,7 @@
- else strmaxcat(LineAcc," ",255);
- if (strlen(LineAcc)>=72)
- {
- - WrLstLine(LineAcc); strcpy(LineAcc," ");
- + WrLstLine(LineAcc); custom_string_copy(LineAcc," ");
- }
- Lauf=Lauf->Next;
- }
- @@ -4438,7 +4448,7 @@
- else
- BEGIN
- strmaxcat(tmp,Blanks(cwidth-3-strlen(tmp)),255);
- - if (*buf=='\0') strcpy(buf,tmp);
- + if (*buf=='\0') custom_string_copy(buf,tmp);
- else
- BEGIN
- strcat(buf," | "); strcat(buf,tmp);
- diff -uN asl-current/asmsub.c asl-newest/asmsub.c
- --- asl-current/asmsub.c 2012-08-22 17:01:45.000000000 -0300
- +++ asl-newest/asmsub.c 2013-12-18 21:08:58.223284813 -0200
- @@ -42,7 +42,7 @@
- * - use strmov()
- *
- * Revision 1.12 2010/04/17 13:14:19 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.11 2008/11/23 10:39:16 alfred
- * - allow strings with NUL characters
- @@ -914,7 +914,7 @@
- *h = '\0';
- if (!GNUErrors)
- - strcpy(h,"> > >");
- + custom_string_copy(h,"> > >");
- p = GetErrorPos();
- if (p[l = strlen(p) - 1] == ' ')
- p[l] = '\0';
- @@ -1323,7 +1323,7 @@
- sprintf(s," %s%s%s",getmessage(Num_ListSegListHead1),SegNames[z],
- getmessage(Num_ListSegListHead2));
- WrLstLine(s);
- - strcpy(s," ");
- + custom_string_copy(s," ");
- l=strlen(SegNames[z])+strlen(getmessage(Num_ListSegListHead1))+strlen(getmessage(Num_ListSegListHead2));
- for (z2=0; z2<l; z2++) strmaxcat(s,"-",255);
- WrLstLine(s);
- @@ -1733,10 +1733,10 @@
- BEGIN
- strmaxcpy(MemVal,MemFlag,255);
- p=strchr(MemVal,',');
- - if (p==Nil) strcpy(TempName,"ASX.TMP");
- + if (p==Nil) custom_string_copy(TempName,"ASX.TMP");
- else
- BEGIN
- - *p=Nil; strcpy(TempName,MemVal);
- + *p=Nil; custom_string_copy(TempName,MemVal);
- strmov(MemVal,p+1);
- END;
- KillBlanks(TempName); KillBlanks(MemVal);
- diff -uN asl-current/bpemu.c asl-newest/bpemu.c
- --- asl-current/bpemu.c 2010-05-01 14:06:35.000000000 -0300
- +++ asl-newest/bpemu.c 2013-12-18 21:08:58.227284813 -0200
- @@ -235,7 +235,7 @@
- BEGIN
- if ((blk.ff_attrib&(FA_LABEL|FA_DIREC))==0)
- BEGIN
- - strcpy(Name+(pos-Mask),blk.ff_name);
- + custom_string_copy(Name+(pos-Mask),blk.ff_name);
- callback(Name);
- END
- res=findnext(&blk);
- @@ -256,7 +256,7 @@
- memcpy(Name,Mask,pos-Mask);
- while (res==0)
- BEGIN
- - strcpy(Name+(pos-Mask),buf.achName); callback(Name);
- + custom_string_copy(Name+(pos-Mask),buf.achName); callback(Name);
- res=DosFindNext(hdir,&buf,sizeof(buf),&rescnt);
- END
- return True;
- diff -uN asl-current/changelog asl-newest/changelog
- --- asl-current/changelog 2013-08-07 16:44:37.000000000 -0300
- +++ asl-newest/changelog 2013-12-18 21:08:58.227284813 -0200
- @@ -1201,7 +1201,7 @@
- 2010-04-17 [Bld77]
- -- Bugfix : address problem of overlapping strcpy()
- +- Bugfix : address problem of overlapping custom_string_copy()
- 2010-06-14 [Bld78]
- diff -uN asl-current/code166.c asl-newest/code166.c
- --- asl-current/code166.c 2010-12-05 21:17:59.000000000 -0200
- +++ asl-newest/code166.c 2013-12-18 21:08:58.227284813 -0200
- @@ -17,10 +17,10 @@
- * - use machine-dependent SFR start when transforming SFR addresses back to absolute
- *
- * Revision 1.7 2010/08/27 14:52:41 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.6 2010/04/17 13:14:19 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:03 alfred
- * - some NetBSD changes
- diff -uN asl-current/code17c4x.c asl-newest/code17c4x.c
- --- asl-current/code17c4x.c 2008-11-23 08:39:16.000000000 -0200
- +++ asl-newest/code17c4x.c 2013-12-18 21:08:58.227284813 -0200
- @@ -412,9 +412,9 @@
- BEGIN
- if (Memo("MOVFP"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- AdrWord=EvalIntExpression(ArgStr[1],UInt5,&OK);
- if (OK)
- diff -uN asl-current/code2650.c asl-newest/code2650.c
- --- asl-current/code2650.c 2013-02-14 18:48:57.000000000 -0200
- +++ asl-newest/code2650.c 2013-12-18 21:08:58.227284813 -0200
- @@ -535,8 +535,8 @@
- int ArgC;
- for (ArgC = ArgCnt; ArgC >= 1; ArgC--)
- - strcpy(ArgStr[ArgC + 1], ArgStr[ArgC]);
- - strcpy(ArgStr[1], pPos + 1);
- + custom_string_copy(ArgStr[ArgC + 1], ArgStr[ArgC]);
- + custom_string_copy(ArgStr[1], pPos + 1);
- *pPos = '\0';
- ArgCnt++;
- }
- diff -uN asl-current/code3203x.c asl-newest/code3203x.c
- --- asl-current/code3203x.c 2010-04-17 10:14:19.000000000 -0300
- +++ asl-newest/code3203x.c 2013-12-18 21:08:58.227284813 -0200
- @@ -15,7 +15,7 @@
- /*****************************************************************************
- * $Log: code3203x.c,v $
- * Revision 1.6 2010/04/17 13:14:19 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2008/11/23 10:39:16 alfred
- * - allow strings with NUL characters
- @@ -944,7 +944,7 @@
- BEGIN
- if (GenOrders[z].May1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- else
- BEGIN
- @@ -955,13 +955,13 @@
- Is3=(OpPart[strlen(OpPart)-1]=='3');
- if ((GenOrders[z].SwapOps) AND (NOT Is3))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if ((Is3) AND (ArgCnt==2))
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]);
- END
- if ((ArgCnt<2) OR (ArgCnt>3) OR ((Is3) AND (NOT GenOrders[z].May3)))
- BEGIN
- @@ -1189,7 +1189,7 @@
- PrevSrc1Mode=CurrSrc1Mode; PrevSrc1Part=CurrSrc1Part;
- PrevSrc2Mode=CurrSrc2Mode; PrevSrc2Part=CurrSrc2Part;
- PrevDestMode=CurrDestMode; PrevDestPart=CurrDestPart;
- - strcpy(PrevOp,OpPart); PrevARs=ARs; z2=z;
- + custom_string_copy(PrevOp,OpPart); PrevARs=ARs; z2=z;
- if (Is3)
- DAsmCode[0]=0x20000000+(((LongWord)GenOrders[z].Code3) << 23)
- +(((LongWord)CurrDestPart) << 16)
- @@ -1236,7 +1236,7 @@
- if ((strncmp(OpPart,"LDI",3)==0) OR (strncmp(OpPart,"LDF",3)==0))
- BEGIN
- - strcpy(HOp,OpPart); strmov(OpPart,OpPart+3);
- + custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+3);
- for (z=0; z<ConditionCount; z++)
- if (Memo(Conditions[z].Name))
- BEGIN
- @@ -1347,7 +1347,7 @@
- if (*OpPart=='B')
- BEGIN
- - strcpy(HOp,OpPart);
- + custom_string_copy(HOp,OpPart);
- strmov(OpPart,OpPart+1);
- l=strlen(OpPart);
- if ((l>=1) AND (OpPart[l-1]=='D'))
- @@ -1389,7 +1389,7 @@
- if (strncmp(OpPart,"CALL",4)==0)
- BEGIN
- - strcpy(HOp,OpPart); strmov(OpPart,OpPart+4);
- + custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+4);
- for (z=0; z<ConditionCount; z++)
- if (Memo(Conditions[z].Name))
- BEGIN
- @@ -1420,7 +1420,7 @@
- if (strncmp(OpPart,"DB",2)==0)
- BEGIN
- - strcpy(HOp,OpPart);
- + custom_string_copy(HOp,OpPart);
- strmov(OpPart,OpPart+2);
- l=strlen(OpPart);
- if ((l>=1) AND (OpPart[l-1]=='D'))
- @@ -1477,7 +1477,7 @@
- if ((strncmp(OpPart,"RETI",4)==0) OR (strncmp(OpPart,"RETS",4)==0))
- BEGIN
- DFlag=(OpPart[3]=='S')?(1l << 23):(0);
- - strcpy(HOp,OpPart); strmov(OpPart,OpPart+4);
- + custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+4);
- for (z=0; z<ConditionCount; z++)
- if (Memo(Conditions[z].Name))
- BEGIN
- @@ -1495,7 +1495,7 @@
- if (strncmp(OpPart,"TRAP",4)==0)
- BEGIN
- - strcpy(HOp,OpPart); strmov(OpPart,OpPart+4);
- + custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+4);
- for (z=0; z<ConditionCount; z++)
- if (Memo(Conditions[z].Name))
- BEGIN
- diff -uN asl-current/code3206x.c asl-newest/code3206x.c
- --- asl-current/code3206x.c 2010-04-17 10:14:19.000000000 -0300
- +++ asl-newest/code3206x.c 2013-12-18 21:08:58.231284814 -0200
- @@ -19,7 +19,7 @@
- /*****************************************************************************
- * $Log: code3206x.c,v $
- * Revision 1.7 2010/04/17 13:14:19 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2008/11/23 10:39:16 alfred
- * - allow strings with NUL characters
- @@ -208,13 +208,13 @@
- p=FirstBlank(ArgStr[1]);
- if (p==Nil)
- BEGIN
- - strcpy(OpPart,ArgStr[1]);
- - for (z=2; z<=ArgCnt; z++) strcpy(ArgStr[z-1],ArgStr[z]);
- + custom_string_copy(OpPart,ArgStr[1]);
- + for (z=2; z<=ArgCnt; z++) custom_string_copy(ArgStr[z-1],ArgStr[z]);
- ArgCnt--;
- END
- else
- BEGIN
- - *p='\0'; strcpy(OpPart,ArgStr[1]); strcpy(ArgStr[1],p+1);
- + *p='\0'; custom_string_copy(OpPart,ArgStr[1]); custom_string_copy(ArgStr[1],p+1);
- KillPrefBlanks(ArgStr[1]);
- END
- NLS_UpString(OpPart);
- @@ -222,7 +222,7 @@
- if (p==Nil) *AttrPart='\0';
- else
- BEGIN
- - strcpy(AttrPart,p+1);
- + custom_string_copy(AttrPart,p+1);
- *p='\0';
- END;
- return True;
- @@ -372,7 +372,7 @@
- END
- else
- BEGIN
- - strcpy(RegPart,Asc); *DispPart='\0';
- + custom_string_copy(RegPart,Asc); *DispPart='\0';
- END
- /* Registerfeld entschluesseln */
- @@ -836,8 +836,8 @@
- IsStore=(*OpPart)=='S';
- if (IsStore)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- ThisStore=True;
- END
- if (DecodeAdr(ArgStr[2],MModReg,False,&DReg))
- diff -uN asl-current/code3254x.c asl-newest/code3254x.c
- --- asl-current/code3254x.c 2010-04-17 10:14:20.000000000 -0300
- +++ asl-newest/code3254x.c 2013-12-18 21:08:58.231284814 -0200
- @@ -35,7 +35,7 @@
- /*****************************************************************************
- * $Log: code3254x.c,v $
- * Revision 1.6 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:03 alfred
- * - some NetBSD changes
- @@ -2297,9 +2297,9 @@
- {
- if (Index & 0x0100)
- {
- - strcpy(ArgStr[3], ArgStr[1]);
- - strcpy(ArgStr[1], ArgStr[2]);
- - strcpy(ArgStr[2], ArgStr[3]);
- + custom_string_copy(ArgStr[3], ArgStr[1]);
- + custom_string_copy(ArgStr[1], ArgStr[2]);
- + custom_string_copy(ArgStr[2], ArgStr[3]);
- }
- ForcePageZero = True;
- if (DecodeAdr(ArgStr[2], MModMem))
- @@ -2357,9 +2357,9 @@
- {
- if (Index & 0x0100)
- {
- - strcpy(ArgStr[3], ArgStr[1]);
- - strcpy(ArgStr[1], ArgStr[2]);
- - strcpy(ArgStr[2], ArgStr[3]);
- + custom_string_copy(ArgStr[3], ArgStr[1]);
- + custom_string_copy(ArgStr[1], ArgStr[2]);
- + custom_string_copy(ArgStr[2], ArgStr[3]);
- }
- if (DecodeAdr(ArgStr[2], MModMem))
- {
- diff -uN asl-current/code370.c asl-newest/code370.c
- --- asl-current/code370.c 2010-04-17 10:14:20.000000000 -0300
- +++ asl-newest/code370.c 2013-12-18 21:08:58.231284814 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: code370.c,v $
- * Revision 1.6 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:03 alfred
- * - some NetBSD changes
- @@ -1102,7 +1102,7 @@
- Erg->Typ=TempNone;
- if ((strlen(Asc)<2) OR ((mytoupper(*Asc)!='R') AND (mytoupper(*Asc)!='P'))) return;
- - strcpy(h,Asc+1);
- + custom_string_copy(h,Asc+1);
- if ((*h=='0') AND (strlen(h)>1)) *h='$';
- Erg->Contents.Int=ConstLongInt(h,&err,10);
- if ((NOT err) OR (Erg->Contents.Int<0) OR (Erg->Contents.Int>255)) return;
- diff -uN asl-current/code47c00.c asl-newest/code47c00.c
- --- asl-current/code47c00.c 2005-09-08 14:31:03.000000000 -0300
- +++ asl-newest/code47c00.c 2013-12-18 21:08:58.231284814 -0200
- @@ -504,9 +504,9 @@
- BEGIN
- if ((strcasecmp(ArgStr[1],"A")!=0) AND (strcasecmp(ArgStr[1],"HL")!=0))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if ((strcasecmp(ArgStr[1],"A")!=0) AND (strcasecmp(ArgStr[1],"HL")!=0)) WrError(1350);
- else
- diff -uN asl-current/code48.c asl-newest/code48.c
- --- asl-current/code48.c 2007-11-25 09:47:27.000000000 -0200
- +++ asl-newest/code48.c 2013-12-18 21:08:58.235284814 -0200
- @@ -711,7 +711,7 @@
- OK=False;
- if ((Memo("MOVD")) AND (strcasecmp(ArgStr[1],"A")==0))
- BEGIN
- - strcpy(ArgStr[1],ArgStr[2]); strmaxcpy(ArgStr[2],"A",255); OK=True;
- + custom_string_copy(ArgStr[1],ArgStr[2]); strmaxcpy(ArgStr[2],"A",255); OK=True;
- END
- if (strcasecmp(ArgStr[2],"A")!=0) WrError(1350);
- else if ((strlen(ArgStr[1])!=2) OR (mytoupper(*ArgStr[1])!='P')) WrError(1350);
- @@ -749,7 +749,7 @@
- OK=False;
- if (strcasecmp(ArgStr[2],"A")==0)
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); OK=True;
- + custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); OK=True;
- END
- if (strcasecmp(ArgStr[1],"A")!=0) WrError(1350);
- else
- @@ -888,7 +888,7 @@
- BEGIN
- if (strcasecmp(ArgStr[2],"A")==0)
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
- + custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
- END
- if (strcasecmp(ArgStr[1],"A")!=0) WrError(1350);
- else
- @@ -917,7 +917,7 @@
- BEGIN
- if (strcasecmp(ArgStr[2],"A")==0)
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
- + custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
- END
- if (strcasecmp(ArgStr[1],"A")!=0) WrError(1350);
- else
- diff -uN asl-current/code51.c asl-newest/code51.c
- --- asl-current/code51.c 2010-04-17 10:14:20.000000000 -0300
- +++ asl-newest/code51.c 2013-12-18 21:08:58.235284814 -0200
- @@ -21,7 +21,7 @@
- /*****************************************************************************
- * $Log: code51.c,v $
- * Revision 1.7 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2007/11/24 22:48:04 alfred
- * - some NetBSD changes
- @@ -1197,7 +1197,7 @@
- z=0;
- if ((strcasecmp(ArgStr[2],"A")==0) OR ((MomCPU>=CPU80251) AND (strcasecmp(ArgStr[2],"R11")==0)))
- BEGIN
- - z=0x10; strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
- + z=0x10; custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
- END
- if ((strcasecmp(ArgStr[1],"A")!=0) AND ((MomCPU<CPU80251) OR (strcasecmp(ArgStr[2],"R11")==0))) WrError(1350);
- else if (strcasecmp(ArgStr[2],"@DPTR")==0) PutCode(0xe0+z);
- diff -uN asl-current/code53c8xx.c asl-newest/code53c8xx.c
- --- asl-current/code53c8xx.c 2010-08-27 11:06:17.000000000 -0300
- +++ asl-newest/code53c8xx.c 2013-12-18 21:08:58.235284814 -0200
- @@ -78,13 +78,13 @@
- p = QuotPos(p, ')');
- if (p == Nil)
- BEGIN
- - strcpy(Dest, start); *Src = '\0';
- + custom_string_copy(Dest, start); *Src = '\0';
- END
- else
- BEGIN
- Save = p[1]; p[1] = '\0';
- - strcpy(Dest, start);
- - p[1] = Save; strcpy(Src, p + 1);
- + custom_string_copy(Dest, start);
- + p[1] = Save; custom_string_copy(Src, p + 1);
- END
- END
- @@ -93,7 +93,7 @@
- else if (NOT IsInToken(*p))
- BEGIN
- *Dest = *p; Dest[1] = '\0';
- - strcpy(Src, p + 1);
- + custom_string_copy(Src, p + 1);
- END
- /* Wort ? */
- @@ -103,8 +103,8 @@
- for (; IsInToken(*p); p++)
- if (*p == '\0') break;
- Save = *p; *p = '\0';
- - strcpy(Dest, start);
- - *p = Save; strcpy(Src, p);
- + custom_string_copy(Dest, start);
- + *p = Save; custom_string_copy(Src, p);
- END
- END
- @@ -124,11 +124,11 @@
- p = RQuotPos(p, ')');
- if (p == Nil)
- BEGIN
- - strcpy(Dest, Src); *Src = '\0';
- + custom_string_copy(Dest, Src); *Src = '\0';
- END
- else
- BEGIN
- - strcpy(Dest, p); *p = '\0';
- + custom_string_copy(Dest, p); *p = '\0';
- END
- END
- @@ -145,7 +145,7 @@
- for (; IsInToken(*p); p--)
- if (p <= Src) break;
- if (NOT IsInToken(*p)) p++;
- - strcpy(Dest, p); *p = '\0';
- + custom_string_copy(Dest, p); *p = '\0';
- END
- END
- #endif
- @@ -305,7 +305,7 @@
- BEGIN
- if (Memo("INTFLY"))
- BEGIN
- - ArgCnt = 1; strcpy(ArgStr[1], "0");
- + ArgCnt = 1; custom_string_copy(ArgStr[1], "0");
- END
- else if (Memo("RETURN"))
- BEGIN
- @@ -317,7 +317,7 @@
- BEGIN
- if (ArgCnt == 1)
- BEGIN
- - if (Memo("RETURN")) strcpy(ArgStr[2], ArgStr[1]);
- + if (Memo("RETURN")) custom_string_copy(ArgStr[2], ArgStr[1]);
- else *ArgStr[2] = '\0';
- END
- Buf = 0;
- diff -uN asl-current/code56k.c asl-newest/code56k.c
- --- asl-current/code56k.c 2010-04-17 10:14:20.000000000 -0300
- +++ asl-newest/code56k.c 2013-12-18 21:08:58.239284814 -0200
- @@ -18,7 +18,7 @@
- /*****************************************************************************
- * $Log: code56k.c,v $
- * Revision 1.6 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2008/12/14 20:22:03 alfred
- * - allow forcing of long addresses
- @@ -228,12 +228,12 @@
- p=QuotPos(str,',');
- if (p==Nil)
- BEGIN
- - *RDest='\0'; strcpy(LDest,str);
- + *RDest='\0'; custom_string_copy(LDest,str);
- END
- else
- BEGIN
- *p='\0';
- - strcpy(LDest,str); strcpy(RDest,p+1);
- + custom_string_copy(LDest,str); custom_string_copy(RDest,p+1);
- END
- free(str);
- END
- @@ -1182,7 +1182,7 @@
- else
- BEGIN
- SplitArg(ArgStr[1],Left,Right);
- - if (strchr(Right,',')==Nil) strcpy(Mid,Right);
- + if (strchr(Right,',')==Nil) custom_string_copy(Mid,Right);
- else SplitArg(Right,Mid,Right);
- if (NOT DecodeALUReg(Right,&Reg1,False,False,True)) SetXError(1445,Right);
- else if (NOT DecodeALUReg(Mid,&Reg2,False,False,True)) SetXError(1445,Mid);
- diff -uN asl-current/code601.c asl-newest/code601.c
- --- asl-current/code601.c 2012-01-14 11:04:13.000000000 -0200
- +++ asl-newest/code601.c 2013-12-18 21:08:58.239284814 -0200
- @@ -186,7 +186,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSReg2(strdup(NName),NCode,NMask);
- if (WithOE)
- BEGIN
- @@ -228,7 +228,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSFReg2(strdup(NName),NCode,NMask);
- if (WithFL)
- BEGIN
- @@ -258,7 +258,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSReg2Swap(strdup(NName),NCode,NMask);
- if (WithOE)
- BEGIN
- @@ -300,7 +300,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSReg3(strdup(NName),NCode,NMask);
- if (WithOE)
- BEGIN
- @@ -342,7 +342,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSFReg3(strdup(NName),NCode,NMask);
- if (WithFL)
- BEGIN
- @@ -364,7 +364,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSReg3Swap(strdup(NName),NCode,NMask);
- if (WithFL)
- BEGIN
- @@ -394,7 +394,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSFReg4(strdup(NName),NCode,NMask);
- if (WithFL)
- BEGIN
- @@ -432,7 +432,7 @@
- BEGIN
- String NName;
- - strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
- + custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
- AddSReg2Imm(strdup(NName),NCode,NMask);
- if (WithFL)
- BEGIN
- @@ -1131,7 +1131,7 @@
- BEGIN
- if (ArgCnt==1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT ChkCPU(Reg2Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1169,7 +1169,7 @@
- BEGIN
- if (ArgCnt==1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT ChkCPU(FReg2Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1189,7 +1189,7 @@
- BEGIN
- if (ArgCnt==1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT ChkCPU(Reg2BOrders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1210,7 +1210,7 @@
- BEGIN
- if (ArgCnt==1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT ChkCPU(Reg2SwapOrders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1246,7 +1246,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT ChkCPU(Reg3Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1267,7 +1267,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT ChkCPU(CReg3Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1288,7 +1288,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT ChkCPU(FReg3Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1309,7 +1309,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT ChkCPU(Reg3SwapOrders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1347,8 +1347,8 @@
- BEGIN
- if (ArgCnt==3)
- BEGIN
- - ArgCnt=4; strcpy(ArgStr[4],ArgStr[3]);
- - strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=4; custom_string_copy(ArgStr[4],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=4) WrError(1110);
- else if (NOT ChkCPU(FReg4Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1422,7 +1422,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT ChkCPU(Imm16Orders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1446,7 +1446,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- + ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT ChkCPU(Imm16SwapOrders[z].CPUMask)) WrXError(1500,OpPart);
- @@ -1472,7 +1472,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]); ArgCnt=3;
- + custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]); ArgCnt=3;
- END
- if (ArgCnt!=3) WrError(1110);
- else if (NOT DecodeFPReg(ArgStr[1],&Dest)) WrError(1350);
- @@ -1516,16 +1516,16 @@
- if (ArgCnt==1)
- BEGIN
- ArgCnt=2;
- - if ((Memo("MFTB")) OR (Memo("MFTBL"))) strcpy(ArgStr[2], "268");
- - else if (Memo("MFTBU")) strcpy(ArgStr[2], "269");
- - else if ((Memo("MTTB")) OR (Memo("MTTBL"))) strcpy(ArgStr[2], "284");
- - else if (Memo("MTTBU")) strcpy(ArgStr[2], "285");
- + if ((Memo("MFTB")) OR (Memo("MFTBL"))) custom_string_copy(ArgStr[2], "268");
- + else if (Memo("MFTBU")) custom_string_copy(ArgStr[2], "269");
- + else if ((Memo("MTTB")) OR (Memo("MTTBL"))) custom_string_copy(ArgStr[2], "284");
- + else if (Memo("MTTBU")) custom_string_copy(ArgStr[2], "285");
- /* already swapped */
- END
- else
- if ((ArgCnt == 2) AND ((Memo("MTTB")) OR (Memo("MTTBL")) OR (Memo("MTTBU"))))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT DecodeGenReg(ArgStr[1],&Dest)) WrError(1350);
- @@ -1553,7 +1553,7 @@
- BEGIN
- if (Memo("MTSPR"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT DecodeGenReg(ArgStr[1],&Dest)) WrError(1350);
- @@ -1575,7 +1575,7 @@
- BEGIN
- if (Memo("MTDCR"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (MomCPU>=CPU505) WrXError(1500,OpPart);
- @@ -1598,7 +1598,7 @@
- BEGIN
- if (Memo("MTSR"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (ArgCnt!=2) WrError(1110);
- else if (NOT DecodeGenReg(ArgStr[1],&Dest)) WrError(1350);
- @@ -1830,7 +1830,7 @@
- BEGIN
- if (ArgCnt==3)
- BEGIN
- - strcpy(ArgStr[4],ArgStr[3]); strcpy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
- + custom_string_copy(ArgStr[4],ArgStr[3]); custom_string_copy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
- END
- if (ArgCnt!=4) WrError(1110);
- else if (NOT DecodeGenReg(ArgStr[4],&Src2)) WrError(1350);
- @@ -1871,7 +1871,7 @@
- BEGIN
- if (ArgCnt==3)
- BEGIN
- - strcpy(ArgStr[4],ArgStr[3]); strcpy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
- + custom_string_copy(ArgStr[4],ArgStr[3]); custom_string_copy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
- END
- if (ArgCnt!=4) WrError(1110);
- else
- diff -uN asl-current/code65.c asl-newest/code65.c
- --- asl-current/code65.c 2010-08-27 11:52:41.000000000 -0300
- +++ asl-newest/code65.c 2013-12-18 21:08:58.239284814 -0200
- @@ -15,7 +15,7 @@
- /*****************************************************************************
- * $Log: code65.c,v $
- * Revision 1.4 2010/08/27 14:52:41 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.3 2005/09/08 17:31:03 alfred
- * - add missing include
- @@ -556,7 +556,7 @@
- if (IsIndirect(ArgStr[1]))
- BEGIN
- - strcpy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
- + custom_string_copy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
- ChkZero(s1,&ZeroMode);
- if (ZeroMode==2)
- BEGIN
- @@ -611,7 +611,7 @@
- if ((IsIndirect(ArgStr[1])) AND (strcasecmp(ArgStr[2],"Y")==0))
- BEGIN
- - strcpy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
- + custom_string_copy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
- ChkZero(s1,&ZeroMode);
- AdrVals[0]=EvalIntExpression(s1,UInt8,&ValOK);
- if (ValOK)
- @@ -624,7 +624,7 @@
- else
- BEGIN
- - strcpy(s1,ArgStr[1]);
- + custom_string_copy(s1,ArgStr[1]);
- ChkZero(s1,&ZeroMode);
- if (ZeroMode==2)
- BEGIN
- diff -uN asl-current/code6805.c asl-newest/code6805.c
- --- asl-current/code6805.c 2013-03-31 15:06:47.000000000 -0300
- +++ asl-newest/code6805.c 2013-12-18 21:08:58.239284814 -0200
- @@ -132,15 +132,15 @@
- {
- if (*s=='<')
- {
- - strcpy(serg, s + 1); *pErg = 2;
- + custom_string_copy(serg, s + 1); *pErg = 2;
- }
- else if (*s == '>')
- {
- - strcpy(serg, s + 1); *pErg = 1;
- + custom_string_copy(serg, s + 1); *pErg = 1;
- }
- else
- {
- - strcpy(serg, s); *pErg = 0;
- + custom_string_copy(serg, s); *pErg = 0;
- }
- }
- @@ -964,7 +964,7 @@
- {
- int z;
- - for (z = ArgCnt; z >= 1; z--) strcpy(ArgStr[z + 1], ArgStr[z]);
- + for (z = ArgCnt; z >= 1; z--) custom_string_copy(ArgStr[z + 1], ArgStr[z]);
- *ArgStr[1] = ch; ArgStr[1][1] = '\0'; ArgCnt++;
- OpPart[l - 1] = '\0';
- }
- diff -uN asl-current/code6809.c asl-newest/code6809.c
- --- asl-current/code6809.c 2013-03-31 17:06:19.000000000 -0300
- +++ asl-newest/code6809.c 2013-12-18 21:08:58.239284814 -0200
- @@ -20,7 +20,7 @@
- * - allows Moto16 pseudo-ops for 6809
- *
- * Revision 1.5 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.4 2007/11/24 22:48:04 alfred
- * - some NetBSD changes
- @@ -1133,7 +1133,7 @@
- BAsmCode[1]=EvalIntExpression(ArgStr[1]+1,Int8,&OK);
- if (OK)
- BEGIN
- - for (z2=1; z2<ArgCnt; z2++) strcpy(ArgStr[z2],ArgStr[z2+1]);
- + for (z2=1; z2<ArgCnt; z2++) custom_string_copy(ArgStr[z2],ArgStr[z2+1]);
- ArgCnt--; DecodeAdr();
- if (AdrMode==ModImm) WrError(1350);
- else
- @@ -1165,7 +1165,7 @@
- else if ((BAsmCode[2]<8) OR (BAsmCode[2]>11)) WrError(1980);
- else
- BEGIN
- - strcpy(ArgStr[1],ArgStr[2]); ArgCnt=1; DecodeAdr();
- + custom_string_copy(ArgStr[1],ArgStr[2]); ArgCnt=1; DecodeAdr();
- if (AdrMode!=ModDir) WrError(1350);
- else
- BEGIN
- diff -uN asl-current/code6812.c asl-newest/code6812.c
- --- asl-current/code6812.c 2010-08-27 11:52:41.000000000 -0300
- +++ asl-newest/code6812.c 2013-12-18 21:08:58.243284814 -0200
- @@ -14,10 +14,10 @@
- /*****************************************************************************
- * $Log: code6812.c,v $
- * Revision 1.18 2010/08/27 14:52:41 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.17 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.16 2007/11/24 22:48:04 alfred
- * - some NetBSD changes
- @@ -237,10 +237,10 @@
- int l = strlen(Asc_o);
- if ((*Asc_o == '-') || (*Asc_o == '+'))
- - strcpy(Asc, Asc_o + 1);
- + custom_string_copy(Asc, Asc_o + 1);
- else
- {
- - strcpy(Asc, Asc_o);
- + custom_string_copy(Asc, Asc_o);
- if ((Asc_o[l - 1] == '-') || (Asc_o[l - 1] == '+'))
- Asc[l - 1] = '\0';
- }
- @@ -610,9 +610,9 @@
- if (p >= ArgStr[Src])
- {
- for (z = ArgCnt; z >= Src; z--)
- - strcpy(ArgStr[z + 1], ArgStr[z]);
- + custom_string_copy(ArgStr[z + 1], ArgStr[z]);
- ArgCnt++;
- - *p = '\0'; strcpy(ArgStr[Src + 1], p + 1);
- + *p = '\0'; custom_string_copy(ArgStr[Src + 1], p + 1);
- KillPostBlanks(ArgStr[Src]); KillPrefBlanks(ArgStr[Src + 1]);
- }
- }
- diff -uN asl-current/code68.c asl-newest/code68.c
- --- asl-current/code68.c 2010-04-17 10:14:20.000000000 -0300
- +++ asl-newest/code68.c 2013-12-18 21:08:58.243284814 -0200
- @@ -17,7 +17,7 @@
- /*****************************************************************************
- * $Log: code68.c,v $
- * Revision 1.9 2010/04/17 13:14:20 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.8 2009/04/13 07:53:46 alfred
- * - silence Borlanc C++ warning
- @@ -389,8 +389,8 @@
- while ((p>ArgStr[Src]) AND (NOT isspace((unsigned int) *p))) p--;
- if (p>ArgStr[Src])
- BEGIN
- - for (z=ArgCnt; z>=Src; z--) strcpy(ArgStr[z+1],ArgStr[z]); ArgCnt++;
- - strcpy(ArgStr[Src+1],p+1); *p='\0';
- + for (z=ArgCnt; z>=Src; z--) custom_string_copy(ArgStr[z+1],ArgStr[z]); ArgCnt++;
- + custom_string_copy(ArgStr[Src+1],p+1); *p='\0';
- KillPostBlanks(ArgStr[Src]); KillPrefBlanks(ArgStr[Src+1]);
- END
- END
- @@ -582,9 +582,9 @@
- if (MomCPU==CPU6301)
- {
- - strcpy(ArgStr[ArgCnt + 1], ArgStr[1]);
- - for (z = 1; z <= ArgCnt - 1; z++) strcpy(ArgStr[z], ArgStr[z + 1]);
- - strcpy(ArgStr[ArgCnt], ArgStr[ArgCnt + 1]);
- + custom_string_copy(ArgStr[ArgCnt + 1], ArgStr[1]);
- + for (z = 1; z <= ArgCnt - 1; z++) custom_string_copy(ArgStr[z], ArgStr[z + 1]);
- + custom_string_copy(ArgStr[ArgCnt], ArgStr[ArgCnt + 1]);
- }
- if ((ArgCnt >= 1) && (ArgCnt <= 2)) Try2Split(ArgCnt);
- if ((ArgCnt < 2) || (ArgCnt > 3)) WrError(1110);
- @@ -840,7 +840,7 @@
- (strncmp(OpPart,Op,OpLen)==0) AND
- ((Ch=='A') OR (Ch=='B')))
- BEGIN
- - for (z=ArgCnt; z>=1; z--) strcpy(ArgStr[z+1],ArgStr[z]);
- + for (z=ArgCnt; z>=1; z--) custom_string_copy(ArgStr[z+1],ArgStr[z]);
- ArgStr[1][0]=Ch; ArgStr[1][1]='\0';
- OpPart[OpPartLen-1]='\0'; ArgCnt++;
- END
- diff -uN asl-current/code68k.c asl-newest/code68k.c
- --- asl-current/code68k.c 2012-07-19 17:30:19.000000000 -0300
- +++ asl-newest/code68k.c 2013-12-18 21:08:58.243284814 -0200
- @@ -43,13 +43,13 @@
- * - -
- *
- * Revision 1.15 2010/08/27 14:52:41 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.14 2010/06/13 17:48:57 alfred
- * - do not optimize BSR with zero displacement
- *
- * Revision 1.13 2010/04/17 13:14:21 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.12 2010/03/07 10:45:22 alfred
- * - generalization of Motorola disposal instructions
- @@ -385,7 +385,7 @@
- p = strchr(Arg, '{');
- if (p == Nil) return False;
- - *p = '\0'; strcpy(Desc, p + 1);
- + *p = '\0'; custom_string_copy(Desc, p + 1);
- if ((!*Desc) || (Desc[strlen(Desc) - 1] != '}')) return False;
- Desc[strlen(Desc) - 1] = '\0';
- @@ -700,7 +700,7 @@
- if ((l==5) AND (*Asc=='-') AND (Asc[1]=='(') AND (Asc[4]==')'))
- BEGIN
- - strcpy(CReg,Asc+2); CReg[2]='\0';
- + custom_string_copy(CReg,Asc+2); CReg[2]='\0';
- if (CodeReg(CReg,&rerg))
- if (rerg>7)
- BEGIN
- @@ -712,7 +712,7 @@
- if ((l==5) AND (*Asc=='(') AND (Asc[3]==')') AND (Asc[4]=='+'))
- BEGIN
- - strcpy(CReg,Asc+1); CReg[2]='\0';
- + custom_string_copy(CReg,Asc+1); CReg[2]='\0';
- if (CodeReg(CReg,&rerg))
- if (rerg>7)
- BEGIN
- @@ -765,11 +765,11 @@
- while (((NOT doklamm) OR (*p != ',')) AND (*p != '\0'));
- if (*p == '\0')
- BEGIN
- - strcpy(AdrComps[CompCnt].Name, Asc); *Asc = '\0';
- + custom_string_copy(AdrComps[CompCnt].Name, Asc); *Asc = '\0';
- END
- else
- BEGIN
- - *p = '\0'; strcpy(AdrComps[CompCnt].Name, Asc); strmov(Asc, p + 1);
- + *p = '\0'; custom_string_copy(AdrComps[CompCnt].Name, Asc); strmov(Asc, p + 1);
- END
- if (NOT ClassComp(AdrComps + CompCnt))
- BEGIN
- @@ -793,7 +793,7 @@
- else if (AdrComps[CompCnt].Art == Disp)
- BEGIN
- - strcpy(OutDisp, AdrComps[CompCnt].Name);
- + custom_string_copy(OutDisp, AdrComps[CompCnt].Name);
- if (NOT SplitSize(OutDisp, &OutDispLen))
- return;
- @@ -1066,7 +1066,7 @@
- /* indirektes Argument herauskopieren: */
- - strcpy(Asc,AdrComps[0].Name+1);
- + custom_string_copy(Asc,AdrComps[0].Name+1);
- Asc[strlen(Asc)-1]='\0';
- /* Felder loeschen: */
- @@ -1083,11 +1083,11 @@
- p=strchr(Asc,',');
- if (p==Nil)
- BEGIN
- - strcpy(OneComp.Name,Asc); *Asc='\0';
- + custom_string_copy(OneComp.Name,Asc); *Asc='\0';
- END
- else
- BEGIN
- - *p='\0'; strcpy(OneComp.Name,Asc); strmov(Asc,p+1);
- + *p='\0'; custom_string_copy(OneComp.Name,Asc); strmov(Asc,p+1);
- END
- if (NOT ClassComp(&OneComp))
- BEGIN
- @@ -1285,11 +1285,11 @@
- p = strchr(Asc, '/');
- if (!p)
- {
- - strcpy(s, Asc); *Asc = '\0';
- + custom_string_copy(s, Asc); *Asc = '\0';
- }
- else
- {
- - *p='\0'; strcpy(s, Asc); strmov(Asc, p+1);
- + *p='\0'; custom_string_copy(s, Asc); strmov(Asc, p+1);
- }
- if (*Asc == '/')
- strmov(Asc, Asc + 1);
- @@ -1476,7 +1476,7 @@
- if (ArgCnt == 1)
- {
- - strcpy(ArgStr[2],ArgStr[1]); strcpy(ArgStr[1], "#1");
- + custom_string_copy(ArgStr[2],ArgStr[1]); custom_string_copy(ArgStr[1], "#1");
- ArgCnt = 2;
- }
- if (ArgCnt != 2) WrError(1110);
- @@ -2764,7 +2764,7 @@
- }
- else
- {
- - strcpy(ArgStr[3], p + 1); *p = '\0';
- + custom_string_copy(ArgStr[3], p + 1); *p = '\0';
- DecodeAdr(ArgStr[1], Mdata);
- if (AdrNum != 0)
- {
- @@ -2935,7 +2935,7 @@
- if ((ArgCnt==1) AND (NOT Op->Dya))
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); ArgCnt=2;
- + custom_string_copy(ArgStr[2],ArgStr[1]); ArgCnt=2;
- END
- if (*AttrPart=='\0') OpSize=6;
- if (OpSize==3) WrError(1130);
- @@ -3327,11 +3327,11 @@
- h1=strchr(Asc,'/');
- if (h1==Nil)
- BEGIN
- - strcpy(s,Asc); *Asc='\0';
- + custom_string_copy(s,Asc); *Asc='\0';
- END
- else
- BEGIN
- - *h1='\0'; strcpy(s,Asc); strmov(Asc, h1 + 1);
- + *h1='\0'; custom_string_copy(s,Asc); strmov(Asc, h1 + 1);
- END
- if (strcasecmp(s,"FPCR")==0) hw|=0x400;
- else if (strcasecmp(s,"FPSR")==0) hw|=0x200;
- @@ -3458,7 +3458,7 @@
- p=strchr(AttrPart,'{');
- if (p!=0) /* k-Faktor abspalten */
- BEGIN
- - strcpy(sk,p); *p='\0';
- + custom_string_copy(sk,p); *p='\0';
- END
- else *sk='\0';
- DecodeAdr(ArgStr[2],Mdata+Madr+Madri+Mpost+Mpre+Mdadri+Maix+Mabs+Mfpn+Mfpcr);
- @@ -3602,7 +3602,7 @@
- p=strrchr(ArgStr[2],':');
- if (p!=Nil)
- BEGIN
- - *p='\0'; strcpy(sk,ArgStr[2]); strmov(ArgStr[2],p+1);
- + *p='\0'; custom_string_copy(sk,ArgStr[2]); strmov(ArgStr[2],p+1);
- END
- else *sk='\0';
- DecodeAdr(sk,Mfpn);
- @@ -4440,7 +4440,7 @@
- BEGIN
- if (strchr(ArgStr[2],':')==Nil)
- BEGIN
- - strcpy(ArgStr[3], ArgStr[2]);
- + custom_string_copy(ArgStr[3], ArgStr[2]);
- strcat(ArgStr[2], ":");
- strcat(ArgStr[2], ArgStr[3]);
- END
- diff -uN asl-current/code68rs08.c asl-newest/code68rs08.c
- --- asl-current/code68rs08.c 2013-03-31 15:06:47.000000000 -0300
- +++ asl-newest/code68rs08.c 2013-12-18 21:08:58.243284814 -0200
- @@ -106,15 +106,15 @@
- {
- if (*s=='<') /* short / tiny */
- {
- - strcpy(serg, s + 1); *pErg = 2;
- + custom_string_copy(serg, s + 1); *pErg = 2;
- }
- else if (*s == '>') /* direct */
- {
- - strcpy(serg, s + 1); *pErg = 1;
- + custom_string_copy(serg, s + 1); *pErg = 1;
- }
- else /* let the assembler make the choice */
- {
- - strcpy(serg, s); *pErg = 0;
- + custom_string_copy(serg, s); *pErg = 0;
- }
- }
- @@ -824,7 +824,7 @@
- {
- int z;
- - for (z = ArgCnt; z >= 1; z--) strcpy(ArgStr[z + 1], ArgStr[z]);
- + for (z = ArgCnt; z >= 1; z--) custom_string_copy(ArgStr[z + 1], ArgStr[z]);
- *ArgStr[1] = ch; ArgStr[1][1] = '\0'; ArgCnt++;
- OpPart[l - 1] = '\0';
- }
- diff -uN asl-current/code7000.c asl-newest/code7000.c
- --- asl-current/code7000.c 2010-04-17 10:14:22.000000000 -0300
- +++ asl-newest/code7000.c 2013-12-18 21:08:58.247284814 -0200
- @@ -14,7 +14,7 @@
- /*****************************************************************************
- * $Log: code7000.c,v $
- * Revision 1.7 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2007/11/24 22:48:05 alfred
- * - some NetBSD changes
- @@ -616,7 +616,7 @@
- NIs32=(DOpSize==2);
- if (NOT NIs32) DispAcc&=0xffff;
- /* Literale sektionsspezifisch */
- - strcpy(AdrStr,"[PARENT0]");
- + custom_string_copy(AdrStr,"[PARENT0]");
- /* schon vorhanden ? */
- Lauf=FirstLiteral; p=0; OK=False; Last=Nil; Found=False;
- while ((Lauf!=Nil) AND (NOT Found))
- @@ -836,16 +836,16 @@
- pos = FirstBlank(ArgStr[1]);
- if (!pos)
- {
- - strcpy(OpPart, ArgStr[1]);
- + custom_string_copy(OpPart, ArgStr[1]);
- for (z = 1; z < ArgCnt; z++)
- - strcpy(ArgStr[z], ArgStr[z + 1]);
- + custom_string_copy(ArgStr[z], ArgStr[z + 1]);
- ArgCnt--;
- }
- else
- {
- *pos = '\0';
- - strcpy(OpPart, ArgStr[1]);
- - strcpy(ArgStr[1], pos + 1);
- + custom_string_copy(OpPart, ArgStr[1]);
- + custom_string_copy(ArgStr[1], pos + 1);
- }
- }
- @@ -1029,9 +1029,9 @@
- BEGIN
- if (Memo("LDC"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (DecodeCtrlReg(ArgStr[1],&HReg))
- BEGIN
- @@ -1063,9 +1063,9 @@
- BEGIN
- if (Memo("LDS"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (!DecodeSReg(ArgStr[1], &HReg)) WrError(1440);
- else
- diff -uN asl-current/code75k0.c asl-newest/code75k0.c
- --- asl-current/code75k0.c 2010-04-17 10:14:22.000000000 -0300
- +++ asl-newest/code75k0.c 2013-12-18 21:08:58.247284814 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: code75k0.c,v $
- * Revision 1.5 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.4 2005/10/02 10:00:45 alfred
- * - ConstLongInt gets default base, correct length check on KCPSM3 registers
- @@ -775,9 +775,9 @@
- z=Ord(Memo("IN"));
- if (z>0)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[3]);
- END
- if (strncasecmp(ArgStr[1],"PORT",4)!=0) WrError(1350);
- else
- diff -uN asl-current/code7700.c asl-newest/code7700.c
- --- asl-current/code7700.c 2010-08-27 11:52:42.000000000 -0300
- +++ asl-newest/code7700.c 2013-12-18 21:08:58.247284814 -0200
- @@ -13,10 +13,10 @@
- /*****************************************************************************
- * $Log: code7700.c,v $
- * Revision 1.6 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.5 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.4 2005/09/08 17:31:04 alfred
- * - add missing include
- diff -uN asl-current/code7720.c asl-newest/code7720.c
- --- asl-current/code7720.c 2010-04-17 10:14:22.000000000 -0300
- +++ asl-newest/code7720.c 2013-12-18 21:08:58.247284814 -0200
- @@ -19,7 +19,7 @@
- /*****************************************************************************
- * $Log: code7720.c,v $
- * Revision 1.6 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2008/11/23 10:39:17 alfred
- * - allow strings with NUL characters
- @@ -361,7 +361,7 @@
- {
- strmaxcpy(OpPart, ArgStr[1], 255);
- for (z = 1; z < ArgCnt; z++)
- - strcpy(ArgStr[z], ArgStr[z + 1]);
- + custom_string_copy(ArgStr[z], ArgStr[z + 1]);
- ArgCnt--;
- }
- if (!LookupInstTable(OpTable,OpPart)) WrXError(1200,OpPart);
- diff -uN asl-current/code77230.c asl-newest/code77230.c
- --- asl-current/code77230.c 2010-04-17 10:14:22.000000000 -0300
- +++ asl-newest/code77230.c 2013-12-18 21:08:58.247284814 -0200
- @@ -20,7 +20,7 @@
- /*****************************************************************************
- * $Log: code77230.c,v $
- * Revision 1.7 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2008/11/23 10:39:17 alfred
- * - allow strings with NUL characters
- diff -uN asl-current/code78c10.c asl-newest/code78c10.c
- --- asl-current/code78c10.c 2007-11-26 17:28:34.000000000 -0200
- +++ asl-newest/code78c10.c 2013-12-18 21:08:58.247284814 -0200
- @@ -666,9 +666,9 @@
- BEGIN
- if (strcasecmp(ArgStr[1],"EA")!=0)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- OK=True;
- END
- else OK=False;
- @@ -726,9 +726,9 @@
- BEGIN
- if (strcasecmp(ArgStr[1],"A")!=0)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- OK=False;
- END
- else OK=True;
- diff -uN asl-current/code78k0.c asl-newest/code78k0.c
- --- asl-current/code78k0.c 2010-08-27 11:52:42.000000000 -0300
- +++ asl-newest/code78k0.c 2013-12-18 21:08:58.251284814 -0200
- @@ -13,10 +13,10 @@
- *****************************************************************************
- * $Log: code78k0.c,v $
- * Revision 1.7 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.6 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:05 alfred
- * - some NetBSD changes
- @@ -475,9 +475,9 @@
- {
- if ((strcasecmp(ArgStr[2], "A") == 0) || (strcasecmp(ArgStr[2], "RP1") == 0))
- {
- - strcpy(ArgStr[3], ArgStr[1]);
- - strcpy(ArgStr[1], ArgStr[2]);
- - strcpy(ArgStr[2], ArgStr[3]);
- + custom_string_copy(ArgStr[3], ArgStr[1]);
- + custom_string_copy(ArgStr[1], ArgStr[2]);
- + custom_string_copy(ArgStr[2], ArgStr[3]);
- }
- DecodeAdr(ArgStr[1], MModReg8);
- if (AdrMode != ModNone)
- @@ -882,9 +882,9 @@
- {
- if (!strcasecmp(ArgStr[2], "CY"))
- {
- - strcpy(ArgStr[3], ArgStr[1]);
- - strcpy(ArgStr[1], ArgStr[2]);
- - strcpy(ArgStr[2], ArgStr[3]);
- + custom_string_copy(ArgStr[3], ArgStr[1]);
- + custom_string_copy(ArgStr[1], ArgStr[2]);
- + custom_string_copy(ArgStr[2], ArgStr[3]);
- z = 1;
- }
- else z = 4;
- diff -uN asl-current/code8008.c asl-newest/code8008.c
- --- asl-current/code8008.c 2012-09-16 15:49:23.000000000 -0300
- +++ asl-newest/code8008.c 2013-12-18 21:08:58.251284814 -0200
- @@ -267,7 +267,7 @@
- char Memo[10], *p;
- int z;
- - strcpy(Memo, NName); p = strchr(Memo, '*');
- + custom_string_copy(Memo, NName); p = strchr(Memo, '*');
- for (z = 0; z < 8; z++)
- {
- *p = RegNames[z];
- @@ -285,7 +285,7 @@
- char Memo[10], *p;
- int z;
- - strcpy(Memo, NName); p = strchr(Memo, '*');
- + custom_string_copy(Memo, NName); p = strchr(Memo, '*');
- for (z = 0; z < 8; z++)
- {
- *p = RegNames[z];
- @@ -303,7 +303,7 @@
- char Memo[10], *p;
- int z;
- - strcpy(Memo, NName); p = strchr(Memo, '*');
- + custom_string_copy(Memo, NName); p = strchr(Memo, '*');
- for (z = 0; z < 4; z++)
- {
- *p = FlagNames[z];
- diff -uN asl-current/code807x.c asl-newest/code807x.c
- --- asl-current/code807x.c 2005-09-08 13:53:42.000000000 -0300
- +++ asl-newest/code807x.c 2013-12-18 21:08:58.251284814 -0200
- @@ -658,7 +658,7 @@
- /* allow both syntaxes for PC-relative addressing */
- if (ArgCnt == 1)
- - strcpy(ArgStr[++ArgCnt], "PC");
- + custom_string_copy(ArgStr[++ArgCnt], "PC");
- if (ArgCnt != 2) WrError(1110);
- else
- diff -uN asl-current/code85.c asl-newest/code85.c
- --- asl-current/code85.c 2007-11-25 09:47:29.000000000 -0200
- +++ asl-newest/code85.c 2013-12-18 21:08:58.251284814 -0200
- @@ -345,7 +345,7 @@
- UNUSED(Index);
- if (!ArgCnt)
- - strcpy(ArgStr[++ArgCnt], "B");
- + custom_string_copy(ArgStr[++ArgCnt], "B");
- if (ArgCnt != 1) WrError(1110);
- else if (MomCPU < CPU8085U) WrError(1500);
- @@ -364,7 +364,7 @@
- UNUSED(Index);
- if (!ArgCnt)
- - strcpy(ArgStr[++ArgCnt], "D");
- + custom_string_copy(ArgStr[++ArgCnt], "D");
- if (ArgCnt != 1) WrError(1110);
- else if (MomCPU < CPU8085U) WrError(1500);
- diff -uN asl-current/code86.c asl-newest/code86.c
- --- asl-current/code86.c 2010-08-27 11:52:42.000000000 -0300
- +++ asl-newest/code86.c 2013-12-18 21:08:58.251284814 -0200
- @@ -14,10 +14,10 @@
- /*****************************************************************************
- * $Log: code86.c,v $
- * Revision 1.7 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.6 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2008/04/06 09:37:52 alfred
- * - catch immediate addressing on invalid operand size, some reformatting
- @@ -381,7 +381,7 @@
- }
- else
- {
- - *p = '\0'; strcpy(AddPart, AdrPart); strmov(AdrPart, p + 1);
- + *p = '\0'; custom_string_copy(AddPart, AdrPart); strmov(AdrPart, p + 1);
- }
- if (!strcasecmp(AddPart, "BX"))
- @@ -675,7 +675,7 @@
- BEGIN
- if (Index!=0)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- DecodeAdr(ArgStr[1]);
- switch (AdrType)
- @@ -1843,7 +1843,7 @@
- END
- if (ArgCnt==1)
- BEGIN
- - strcpy (ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
- + custom_string_copy (ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
- END
- if (ArgCnt!=2) WrError(1110);
- else
- @@ -1902,7 +1902,7 @@
- OpAdd=0; if (FMemo("FIIMUL")) OpAdd+=8;
- if (ArgCnt==1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
- END
- if (ArgCnt!=2) WrError(1110);
- else
- @@ -1982,7 +1982,7 @@
- END
- if (ArgCnt==1)
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
- + custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
- END
- if (ArgCnt!=2) WrError(1110);
- else
- @@ -2050,7 +2050,7 @@
- if ((FMemo("FIDIV")) OR (Memo("FIDIVR"))) OpAdd+=16;
- if (ArgCnt==1)
- BEGIN
- - ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
- + ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
- END
- if (ArgCnt!=2) WrError(1110);
- else
- @@ -2273,7 +2273,7 @@
- BEGIN
- if (ArgCnt==2)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]); ArgCnt++;
- + custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]); ArgCnt++;
- END
- BAsmCode[CodeLen]=0x69;
- DecodeAdr(ArgStr[1]);
- diff -uN asl-current/code87c800.c asl-newest/code87c800.c
- --- asl-current/code87c800.c 2010-04-17 10:14:22.000000000 -0300
- +++ asl-newest/code87c800.c 2013-12-18 21:08:58.251284814 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: code87c800.c,v $
- * Revision 1.5 2010/04/17 13:14:22 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.4 2007/11/24 22:48:05 alfred
- * - some NetBSD changes
- diff -uN asl-current/code8x30x.c asl-newest/code8x30x.c
- --- asl-current/code8x30x.c 2007-11-25 09:47:29.000000000 -0200
- +++ asl-newest/code8x30x.c 2013-12-18 21:08:58.251284814 -0200
- @@ -343,7 +343,7 @@
- p=HasDisp(ArgStr[1]); /* kann eine Rotation dabei sein */
- if (p!=Nil)
- BEGIN /* jau! */
- - strcpy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
- + custom_string_copy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
- Rot=EvalIntExpression(tmp,UInt3,&OK);
- if (OK)
- BEGIN
- @@ -427,7 +427,7 @@
- if (p==Nil) WrError(1350);
- else
- BEGIN
- - strcpy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
- + custom_string_copy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
- if (DecodeReg(tmp,&SrcReg,&SrcLen))
- BEGIN
- *p='\0';
- diff -uN asl-current/code90c141.c asl-newest/code90c141.c
- --- asl-current/code90c141.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/code90c141.c 2013-12-18 21:08:58.251284814 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: code90c141.c,v $
- * Revision 1.4 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.3 2006/08/05 12:05:37 alfred
- * - regard spaces in indexed expressions
- diff -uN asl-current/code960.c asl-newest/code960.c
- --- asl-current/code960.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/code960.c 2013-12-18 21:08:58.255284815 -0200
- @@ -24,7 +24,7 @@
- /*****************************************************************************
- * $Log: code960.c,v $
- * Revision 1.6 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:06 alfred
- * - some NetBSD changes
- @@ -330,7 +330,7 @@
- if ((Op->DestType!=NoneOp) AND (ArgCnt==1+Ord(Op->Src2Type!=NoneOp)))
- BEGIN
- - strcpy(ArgStr[ArgCnt+1],ArgStr[ArgCnt]);
- + custom_string_copy(ArgStr[ArgCnt+1],ArgStr[ArgCnt]);
- ArgCnt++;
- END
- diff -uN asl-current/code96c141.c asl-newest/code96c141.c
- --- asl-current/code96c141.c 2010-08-27 11:52:42.000000000 -0300
- +++ asl-newest/code96c141.c 2013-12-18 21:08:58.255284815 -0200
- @@ -18,7 +18,7 @@
- /*****************************************************************************
- * $Log: code96c141.c,v $
- * Revision 1.9 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.8 2007/11/24 22:48:06 alfred
- * - some NetBSD changes
- @@ -231,7 +231,7 @@
- if ((l == 4) AND ((*Asc == 'Q') OR (*Asc == 'R')) AND ((Asc[3] >= '0') AND (Asc[3] <= '7')))
- BEGIN
- - strcpy(HAsc, Asc + 1); HAsc[2] = '\0';
- + custom_string_copy(HAsc, Asc + 1); HAsc[2] = '\0';
- for (z = 0; z < RegCnt >> 1; z++)
- if (strcmp(HAsc, Reg16Names[z]) == 0)
- BEGIN
- @@ -294,7 +294,7 @@
- if (((l == 3) OR ((l == 4) AND (*Asc == 'Q')))
- AND ((Asc[l - 1] == 'L') OR (Asc[l - 1] == 'H')))
- BEGIN
- - strcpy(HAsc, Asc + (l - 3)); HAsc[2] = '\0';
- + custom_string_copy(HAsc, Asc + (l - 3)); HAsc[2] = '\0';
- for (z = 0; z < RegCnt >> 1; z++)
- if (strcmp(HAsc, Reg16Names[z + 4]) == 0)
- BEGIN
- @@ -318,7 +318,7 @@
- if (((l == 3) OR ((l == 4) AND (*Asc == 'Q'))) AND (IsQuot(Asc[l - 1])))
- BEGIN
- - strcpy(HAsc, Asc + 1); HAsc[l - 2] = '\0';
- + custom_string_copy(HAsc, Asc + 1); HAsc[l - 2] = '\0';
- for (z = 0; z < RegCnt >> 1; z++)
- if (strcmp(HAsc, Reg16Names[z]) == 0)
- BEGIN
- @@ -332,7 +332,7 @@
- if ((l == 4) AND (IsQuot(Asc[3])))
- BEGIN
- - strcpy(HAsc, Asc); HAsc[3] = '\0';
- + custom_string_copy(HAsc, Asc); HAsc[3] = '\0';
- for (z = 0; z < RegCnt >> 1; z++)
- if (strcmp(HAsc, Reg32Names[z]) == 0)
- BEGIN
- @@ -484,7 +484,7 @@
- if ((strlen(Asc)>4) AND (Asc[strlen(Asc)-1]==')') AND (strncmp(Asc,"(-",2)==0))
- BEGIN
- - strcpy(HAsc,Asc+2); HAsc[strlen(HAsc)-1]='\0';
- + custom_string_copy(HAsc,Asc+2); HAsc[strlen(HAsc)-1]='\0';
- if (CodeEReg(HAsc,&HNum,&HSize)!=2) WrError(1350);
- else if (NOT IsRegBase(HNum,HSize)) WrError(1350);
- else
- @@ -499,7 +499,7 @@
- if ((strlen(Asc)>4) AND (Asc[0]=='(') AND (strncmp(Asc+strlen(Asc)-2,"+)",2)==0))
- BEGIN
- - strcpy(HAsc,Asc+1); HAsc[strlen(HAsc)-2]='\0';
- + custom_string_copy(HAsc,Asc+1); HAsc[strlen(HAsc)-2]='\0';
- if (CodeEReg(HAsc,&HNum,&HSize)!=2) WrError(1350);
- else if (NOT IsRegBase(HNum,HSize)) WrError(1350);
- else
- @@ -516,7 +516,7 @@
- BEGIN
- NegFlag=False; NNegFlag=False; FirstFlag=False;
- PartMask=0; DispAcc=0; BaseReg=IndReg=BaseSize=IndSize=0xff;
- - strcpy(Rest,Asc+1); Rest[strlen(Rest)-1]='\0';
- + custom_string_copy(Rest,Asc+1); Rest[strlen(Rest)-1]='\0';
- do
- BEGIN
- @@ -535,7 +535,7 @@
- WrError(1350); return;
- END
- strncpy(HAsc,Rest,EPos-Rest); HAsc[EPos-Rest]='\0';
- - if (EPos<Rest+strlen(Rest)) strcpy(Rest,EPos+1); else *Rest='\0';
- + if (EPos<Rest+strlen(Rest)) custom_string_copy(Rest,EPos+1); else *Rest='\0';
- KillPrefBlanks(HAsc); KillPostBlanks(HAsc);
- switch (CodeEReg(HAsc,&HNum,&HSize))
- diff -uN asl-current/code97c241.c asl-newest/code97c241.c
- --- asl-current/code97c241.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/code97c241.c 2013-12-18 21:08:58.255284815 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: code97c241.c,v $
- * Revision 1.7 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2007/11/24 22:48:06 alfred
- * - some NetBSD changes
- @@ -504,7 +504,7 @@
- EPos=QuotPos(AdrPart,'*');
- if (EPos!=Nil)
- BEGIN
- - strcpy(tmp,AdrPart); tmp[EPos-AdrPart]='\0';
- + custom_string_copy(tmp,AdrPart); tmp[EPos-AdrPart]='\0';
- END
- l=strlen(AdrPart);
- if ((EPos==AdrPart+l-2)
- @@ -1219,7 +1219,7 @@
- else
- BEGIN
- if (p==AttrPart) Format=' '; else Format=(*AttrPart);
- - strcpy(AttrPart,p+1);
- + custom_string_copy(AttrPart,p+1);
- END
- break;
- default:
- @@ -1272,7 +1272,7 @@
- BEGIN
- if ((NOT IsIndirect(ArgStr[1])) AND ((RMWOrders[z].Mask & 0x20)!=0))
- BEGIN
- - sprintf(ArgStr[2],"(%s)",ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]);
- + sprintf(ArgStr[2],"(%s)",ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]);
- END
- DecodeAdr(ArgStr[1],0,(RMWOrders[z].Mask & 0x10)==0,(RMWOrders[z].Mask & 0x20)==0);
- if (AdrOK)
- @@ -1476,9 +1476,9 @@
- BEGIN
- if (z==2)
- BEGIN
- - strcpy(ArgStr[5],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[5]);
- + custom_string_copy(ArgStr[5],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[5]);
- END
- if (NOT DecodeReg(ArgStr[1],&Reg)) WrError(1350);
- else if ((Reg >> 6)!=1) WrError(1130);
- diff -uN asl-current/codeace.c asl-newest/codeace.c
- --- asl-current/codeace.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/codeace.c 2013-12-18 21:08:58.255284815 -0200
- @@ -21,7 +21,7 @@
- /*****************************************************************************
- * $Log: codeace.c,v $
- * Revision 1.4 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.3 2005/09/08 16:53:42 alfred
- * - use common PInstTable
- diff -uN asl-current/codecop8.c asl-newest/codecop8.c
- --- asl-current/codecop8.c 2006-04-09 09:40:11.000000000 -0300
- +++ asl-newest/codecop8.c 2013-12-18 21:08:58.255284815 -0200
- @@ -333,7 +333,7 @@
- BEGIN
- if (strcasecmp(ArgStr[1],"A")!=0)
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- DecodeAdr(ArgStr[1],MModAcc);
- if (AdrMode!=ModNone)
- diff -uN asl-current/codeh8_3.c asl-newest/codeh8_3.c
- --- asl-current/codeh8_3.c 2011-08-01 16:56:08.000000000 -0300
- +++ asl-newest/codeh8_3.c 2013-12-18 21:08:58.259284815 -0200
- @@ -17,10 +17,10 @@
- * - add attribute type to error message
- *
- * Revision 1.6 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.5 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.4 2007/11/24 22:48:06 alfred
- * - some NetBSD changes
- @@ -966,8 +966,8 @@
- BEGIN
- if (Memo("MOVTPE"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[3]);
- END
- DecodeAdr(ArgStr[2],MModReg);
- if (AdrMode!=ModNone)
- @@ -1016,8 +1016,8 @@
- BEGIN
- if (Memo("STC"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- z=0x80;
- END
- else z=0;
- diff -uN asl-current/codeh8_5.c asl-newest/codeh8_5.c
- --- asl-current/codeh8_5.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/codeh8_5.c 2013-12-18 21:08:58.259284815 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: codeh8_5.c,v $
- * Revision 1.8 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.7 2009/12/21 21:07:15 alfred
- * - allow unsigned 16 bit displacements
- @@ -1488,11 +1488,11 @@
- if (p < AttrPart + strlen(AttrPart) - 1)
- strmaxcpy(Format, p + 1, STRINGSIZE - 1);
- else
- - strcpy(Format, " ");
- + custom_string_copy(Format, " ");
- *p = '\0';
- }
- else
- - strcpy(Format, " ");
- + custom_string_copy(Format, " ");
- break;
- case ':':
- p = strchr(AttrPart, '.');
- @@ -1505,14 +1505,14 @@
- {
- *p = '\0';
- if (p == AttrPart)
- - strcpy(Format, " ");
- + custom_string_copy(Format, " ");
- else
- strmaxcpy(Format, AttrPart, STRINGSIZE - 1);
- - strcpy(AttrPart, p + 1);
- + custom_string_copy(AttrPart, p + 1);
- }
- break;
- default:
- - strcpy(Format, " ");
- + custom_string_copy(Format, " ");
- }
- /* Attribut abarbeiten */
- diff -uN asl-current/codem16.c asl-newest/codem16.c
- --- asl-current/codem16.c 2010-08-27 11:52:42.000000000 -0300
- +++ asl-newest/codem16.c 2013-12-18 21:08:58.259284815 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: codem16.c,v $
- * Revision 1.6 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.5 2007/11/24 22:48:07 alfred
- * - some NetBSD changes
- @@ -430,7 +430,7 @@
- *p='\0'; strmaxcpy(Part,Asc,255); strmov(Asc,p+1);
- END
- - strcpy(SReg,Part); p=QuotPos(SReg,'*'); if (p!=Nil) *p='\0';
- + custom_string_copy(SReg,Part); p=QuotPos(SReg,'*'); if (p!=Nil) *p='\0';
- /* weitere Indirektion ? */
- @@ -1120,7 +1120,7 @@
- BEGIN
- if (OptionCnt<2)
- BEGIN
- - for (z=OptionCnt-1; z>=0; z--) strcpy(Options[z+1],Options[z]);
- + for (z=OptionCnt-1; z>=0; z--) custom_string_copy(Options[z+1],Options[z]);
- OptionCnt++; strmaxcpy(Options[0],p+1,255);
- END
- *p='\0';
- @@ -1473,7 +1473,7 @@
- for (z=0; z<MulOrderCount; z++)
- if (Memo(MulOrders[z]))
- BEGIN
- - strcpy(Form,(Odd(z)) ? "GE" : "GER");
- + custom_string_copy(Form,(Odd(z)) ? "GE" : "GER");
- if (ArgCnt!=2) WrError(1110);
- else if (CheckFormat(Form))
- if (GetOpSize(ArgStr[1],1))
- @@ -1709,7 +1709,7 @@
- for (z=0; z<BitOrderCount; z++)
- if (Memo(BitOrders[z].Name))
- BEGIN
- - strcpy(Form,(BitOrders[z].Code2!=0) ? "GER" : "GE");
- + custom_string_copy(Form,(BitOrders[z].Code2!=0) ? "GER" : "GE");
- if (ArgCnt!=2) WrError(1110);
- else if (CheckFormat(Form))
- if (GetOpSize(ArgStr[1],1))
- @@ -1998,10 +1998,10 @@
- if (p!=Nil)
- BEGIN
- if (p<AttrPart+strlen(AttrPart)-1) strmaxcpy(Format,p+1,STRINGSIZE-1);
- - else strcpy(Format," ");
- + else custom_string_copy(Format," ");
- *p='\0';
- END
- - else strcpy(Format," ");
- + else custom_string_copy(Format," ");
- break;
- case ':':
- p=strchr(AttrPart,'.');
- @@ -2012,11 +2012,11 @@
- else
- BEGIN
- *p='\0';
- - if (p==AttrPart) strcpy(Format," "); else strmaxcpy(Format,AttrPart,STRINGSIZE-1);
- + if (p==AttrPart) custom_string_copy(Format," "); else strmaxcpy(Format,AttrPart,STRINGSIZE-1);
- END
- break;
- default:
- - strcpy(Format," ");
- + custom_string_copy(Format," ");
- END
- NLS_UpString(Format);
- @@ -2574,9 +2574,9 @@
- if (Memo("EXITD"))
- BEGIN
- z=1;
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- else z=0;
- if (ArgCnt!=2) WrError(1110);
- @@ -2668,11 +2668,11 @@
- SplitOptions();
- if (strcasecmp(Options[0],"F")==0)
- BEGIN
- - Mask=0; strcpy(Options[0],Options[1]); OptionCnt--;
- + Mask=0; custom_string_copy(Options[0],Options[1]); OptionCnt--;
- END
- else if (strcasecmp(Options[0],"B")==0)
- BEGIN
- - Mask=1; strcpy(Options[0],Options[1]); OptionCnt--;
- + Mask=1; custom_string_copy(Options[0],Options[1]); OptionCnt--;
- END
- else if (strcasecmp(Options[1],"F")==0)
- BEGIN
- @@ -2719,7 +2719,7 @@
- if (Memo("LDM"))
- BEGIN
- z=0x1000; Mask+=MModPop;
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- else
- BEGIN
- diff -uN asl-current/codem16c.c asl-newest/codem16c.c
- --- asl-current/codem16c.c 2010-04-11 08:38:43.000000000 -0300
- +++ asl-newest/codem16c.c 2013-12-18 21:08:58.259284815 -0200
- @@ -919,9 +919,9 @@
- BEGIN
- if (Memo("STC"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- z=1;
- END
- else z=0;
- @@ -994,9 +994,9 @@
- BEGIN
- if (Memo("LDE"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]);
- - strcpy(ArgStr[1],ArgStr[2]);
- - strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]);
- + custom_string_copy(ArgStr[1],ArgStr[2]);
- + custom_string_copy(ArgStr[2],ArgStr[3]);
- z=1;
- END
- else z=0;
- @@ -1323,7 +1323,7 @@
- if (p<AttrPart+strlen(AttrPart)-1) strmaxcpy(Format,p+1,STRINGSIZE-1);
- *p='\0';
- END
- - else strcpy(Format," ");
- + else custom_string_copy(Format," ");
- break;
- case ':':
- p=strchr(AttrPart,'.');
- @@ -1338,7 +1338,7 @@
- END
- break;
- default:
- - strcpy(Format," ");
- + custom_string_copy(Format," ");
- END
- /* Attribut abarbeiten */
- diff -uN asl-current/codescmp.c asl-newest/codescmp.c
- --- asl-current/codescmp.c 2013-03-07 17:10:11.000000000 -0300
- +++ asl-newest/codescmp.c 2013-12-18 21:08:58.259284815 -0200
- @@ -16,7 +16,7 @@
- * - correct PC-relative addressing for SC/MP
- *
- * Revision 1.6 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2009/04/13 07:36:50 alfred
- * - clean up SC/MP target, correct PC-relative addressing
- diff -uN asl-current/codest7.c asl-newest/codest7.c
- --- asl-current/codest7.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/codest7.c 2013-12-18 21:08:58.263284815 -0200
- @@ -13,7 +13,7 @@
- /*****************************************************************************
- * $Log: codest7.c,v $
- * Revision 1.5 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.4 2007/11/24 22:48:07 alfred
- * - some NetBSD changes
- diff -uN asl-current/codest9.c asl-newest/codest9.c
- --- asl-current/codest9.c 2010-04-17 10:14:23.000000000 -0300
- +++ asl-newest/codest9.c 2013-12-18 21:08:58.263284815 -0200
- @@ -15,7 +15,7 @@
- /*****************************************************************************
- * $Log: codest9.c,v $
- * Revision 1.6 2010/04/17 13:14:23 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/06/28 20:27:31 alfred
- * - silence some warnings on recent GNU C versions
- @@ -401,7 +401,7 @@
- if (OK)
- BEGIN
- - strcpy(Reg,p+2); Reg[strlen(Reg)-1]='\0'; p[1]='\0';
- + custom_string_copy(Reg,p+2); Reg[strlen(Reg)-1]='\0'; p[1]='\0';
- if (DecodeReg(Reg,&AdrPart,&Size))
- if (Size==0) /* d(r) */
- BEGIN
- diff -uN asl-current/codexa.c asl-newest/codexa.c
- --- asl-current/codexa.c 2010-04-17 10:14:24.000000000 -0300
- +++ asl-newest/codexa.c 2013-12-18 21:08:58.263284815 -0200
- @@ -23,7 +23,7 @@
- /*****************************************************************************
- * $Log: codexa.c,v $
- * Revision 1.6 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:07 alfred
- * - some NetBSD changes
- diff -uN asl-current/codexgate.c asl-newest/codexgate.c
- --- asl-current/codexgate.c 2010-04-17 10:14:24.000000000 -0300
- +++ asl-newest/codexgate.c 2013-12-18 21:08:58.351284819 -0200
- @@ -8,7 +8,7 @@
- /*****************************************************************************
- * $Log: codexgate.c,v $
- * Revision 1.6 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.5 2007/11/24 22:48:08 alfred
- * - some NetBSD changes
- diff -uN asl-current/codez80.c asl-newest/codez80.c
- --- asl-current/codez80.c 2013-05-26 06:41:26.000000000 -0300
- +++ asl-newest/codez80.c 2013-12-18 21:08:58.351284819 -0200
- @@ -1293,7 +1293,7 @@
- BEGIN
- if (ArgCnt==1)
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); ArgCnt=2;
- + custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); ArgCnt=2;
- END
- if (ArgCnt!=2) WrError(1110);
- else if (strcasecmp(ArgStr[1],"HL")==0)
- @@ -1806,7 +1806,7 @@
- BEGIN
- if (ArgCnt==1)
- BEGIN
- - strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"HL",255); ArgCnt=2;
- + custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"HL",255); ArgCnt=2;
- END
- if (MomCPU<CPUZ380) WrError(1500);
- else if (ArgCnt!=2) WrError(1110);
- @@ -1947,17 +1947,17 @@
- /* copy out new opcode */
- *ptr = '\0';
- - strcpy(OpPart, ArgStr[1]);
- + custom_string_copy(OpPart, ArgStr[1]);
- NLS_UpString(OpPart);
- /* cut down arg or eliminate it completely */
- if (*ptr2)
- - strcpy(ArgStr[1], ptr2);
- + custom_string_copy(ArgStr[1], ptr2);
- else
- {
- for (z = 1; z < ArgCnt; z++)
- - strcpy(ArgStr[z], ArgStr[z + 1]);
- + custom_string_copy(ArgStr[z], ArgStr[z + 1]);
- ArgCnt--;
- }
- }
- @@ -2276,7 +2276,7 @@
- BEGIN
- if (Memo("OUT"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- if (strcasecmp(ArgStr[2],"(C)")==0)
- BEGIN
- @@ -2331,7 +2331,7 @@
- BEGIN
- if (Memo("OUTW"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END;
- if (strcasecmp(ArgStr[2],"(C)")!=0) WrError(1350);
- else
- @@ -2378,7 +2378,7 @@
- BEGIN
- if (Memo("OUT0"))
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- OpSize=0;
- if (ArgCnt==1)
- @@ -2416,7 +2416,7 @@
- BEGIN
- if (*OpPart=='O')
- BEGIN
- - strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
- + custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
- END
- OpSize=Ord(OpPart[strlen(OpPart)-1]=='W');
- if (((OpSize==0) AND (strcasecmp(ArgStr[1],"A")!=0))
- diff -uN asl-current/codez8.c asl-newest/codez8.c
- --- asl-current/codez8.c 2012-12-09 10:32:06.000000000 -0200
- +++ asl-newest/codez8.c 2013-12-18 21:08:58.351284819 -0200
- @@ -25,7 +25,7 @@
- * - allow arbitrary RP values on eZ8
- *
- * Revision 1.8 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.7 2007/11/24 22:48:08 alfred
- * - some NetBSD changes
- Common subdirectories: asl-current/doc_DE and asl-newest/doc_DE
- Common subdirectories: asl-current/doc_EN and asl-newest/doc_EN
- diff -uN asl-current/findhyphen.c asl-newest/findhyphen.c
- --- asl-current/findhyphen.c 2007-12-31 11:51:06.000000000 -0200
- +++ asl-newest/findhyphen.c 2013-12-18 21:08:58.351284819 -0200
- @@ -103,7 +103,7 @@
- for (run=Patterns; *run!=NULL; run++)
- BEGIN
- - strcpy(sing,*run); rrun=sing;
- + custom_string_copy(sing,*run); rrun=sing;
- do
- BEGIN
- pos=strchr(rrun,' '); if (pos!=Nil) *pos='\0';
- Common subdirectories: asl-current/include and asl-newest/include
- diff -uN asl-current/Makefile.def asl-newest/Makefile.def
- --- asl-current/Makefile.def 1969-12-31 21:00:00.000000000 -0300
- +++ asl-newest/Makefile.def 2013-12-18 21:08:58.351284819 -0200
- @@ -0,0 +1,31 @@
- +# -------------------------------------------------------------------------
- +# choose your compiler (must be ANSI-compliant!) and linker command, plus
- +# any additionally needed flags
- +
- +CC = gcc
- +LD = gcc
- +CFLAGS = -O3 -fomit-frame-pointer -Wall
- +LDFLAGS =
- +
- +TARG_OBJEXTENSION = .o
- +TARG_EXEXTENSION =
- +
- +HOST_OBJEXTENSION = $(TARG_OBJEXTENSION)
- +HOST_EXEXTENSION = $(TARG_EXEXTENSION)
- +
- +# -------------------------------------------------------------------------
- +# directories where binaries, includes, and manpages should go during
- +# installation
- +
- +BINDIR = /usr/local/bin
- +INCDIR = /usr/local/include/asl
- +MANDIR = /usr/local/man
- +LIBDIR = /usr/local/lib/asl
- +DOCDIR = /usr/local/doc/asl
- +
- +# -------------------------------------------------------------------------
- +# character encoding to use (choose one of them)
- +
- +# CHARSET = CHARSET_ASCII7
- +# CHARSET = CHARSET_IBM437
- +CHARSET = CHARSET_ISO8859_1
- Common subdirectories: asl-current/Makefile.def-samples and asl-newest/Makefile.def-samples
- diff -uN asl-current/Makefile.dep asl-newest/Makefile.dep
- --- asl-current/Makefile.dep 2013-08-07 18:04:36.000000000 -0300
- +++ asl-newest/Makefile.dep 2013-12-18 21:12:40.855294043 -0200
- @@ -230,7 +230,7 @@
- motpseudo.o: stdinc.h bpemu.h endian.h strutil.h asmdef.h asmsub.h asmpars.h asmitree.h asmallg.h motpseudo.h
- -natpseudo.o: stdinc.h bpemu.h asmdef.h asmsub.h asmpars.h codepseudo.h natpseudo.h
- +natpseudo.o: stdinc.h bpemu.h asmdef.h asmsub.h asmpars.h codepseudo.h natpseudo.h strutil.h
- nlmessages.o: stdinc.h strutil.h endian.h bpemu.h nls.h nlmessages.h
- Common subdirectories: asl-current/man and asl-newest/man
- diff -uN asl-current/motpseudo.c asl-newest/motpseudo.c
- --- asl-current/motpseudo.c 2010-08-27 11:52:42.000000000 -0300
- +++ asl-newest/motpseudo.c 2013-12-18 21:08:58.351284819 -0200
- @@ -9,10 +9,10 @@
- /*****************************************************************************
- * $Log: motpseudo.c,v $
- * Revision 1.13 2010/08/27 14:52:42 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.12 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.11 2010/03/14 11:40:19 alfred
- * silence compiler warning
- @@ -421,12 +421,12 @@
- sprintf(s, "%0.16e", F); pSplit = strchr(s, 'e');
- if (!pSplit)
- {
- - strcpy(Man, s); strcpy(Exp, "+0000");
- + custom_string_copy(Man, s); custom_string_copy(Exp, "+0000");
- }
- else
- {
- *pSplit = '\0';
- - strcpy(Man, s); strcpy(Exp, pSplit + 1);
- + custom_string_copy(Man, s); custom_string_copy(Exp, pSplit + 1);
- }
- memset(pDest, 0, 12);
- diff -uN asl-current/natpseudo.c asl-newest/natpseudo.c
- --- asl-current/natpseudo.c 2006-04-09 10:24:17.000000000 -0300
- +++ asl-newest/natpseudo.c 2013-12-18 21:08:58.351284819 -0200
- @@ -27,6 +27,7 @@
- #include "codepseudo.h"
- #include "natpseudo.h"
- +#include "strutil.h"
- /*****************************************************************************
- * Global Functions
- @@ -47,21 +48,21 @@
- if (Memo("ADDR"))
- {
- - strcpy(OpPart, "DB");
- + custom_string_copy(OpPart, "DB");
- *pBigFlag = True;
- }
- if (Memo("ADDRW"))
- {
- - strcpy(OpPart, "DW");
- + custom_string_copy(OpPart, "DW");
- *pBigFlag = True;
- }
- if (Memo("BYTE"))
- - strcpy(OpPart, "DB");
- + custom_string_copy(OpPart, "DB");
- if (Memo("WORD"))
- - strcpy(OpPart,"DW");
- + custom_string_copy(OpPart,"DW");
- if ((Memo("DSB")) || (Memo("DSW")))
- {
- diff -uN asl-current/nls.c asl-newest/nls.c
- --- asl-current/nls.c 2010-08-27 11:52:43.000000000 -0300
- +++ asl-newest/nls.c 2013-12-18 21:08:58.351284819 -0200
- @@ -12,7 +12,7 @@
- /*****************************************************************************
- * $Log: nls.c,v $
- * Revision 1.2 2010/08/27 14:52:43 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.1 2003/11/06 02:49:24 alfred
- * - recreated
- diff -uN asl-current/rescomp.c asl-newest/rescomp.c
- --- asl-current/rescomp.c 2012-09-02 06:26:01.000000000 -0300
- +++ asl-newest/rescomp.c 2013-12-18 21:08:58.355284819 -0200
- @@ -209,10 +209,10 @@
- PCat->CtryCodeCnt = 0;
- for (p2 = p; ((*p2) && (!myisspace(*p2))); p2++);
- if (*p2 == '\0')
- - strcpy(Part, p);
- + custom_string_copy(Part, p);
- else
- {
- - *p2 = '\0'; strcpy(Part, p);
- + *p2 = '\0'; custom_string_copy(Part, p);
- for (p = p2 + 1; ((*p) && (isspace((unsigned int) *p2))); p++);
- }
- if ((!*Part) || (Part[strlen(Part)-1] != ')')) SynError(Part);
- diff -uN asl-current/strutil.c asl-newest/strutil.c
- --- asl-current/strutil.c 2013-08-07 16:44:38.000000000 -0300
- +++ asl-newest/strutil.c 2013-12-18 21:12:24.619293370 -0200
- @@ -24,7 +24,7 @@
- * - handle cases where strcpy is a macro
- *
- * Revision 1.7 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2008/11/23 10:39:17 alfred
- * - allow strings with NUL characters
- @@ -193,7 +193,7 @@
- fprintf(stderr,"strdup: out of memory?\n"); exit(255);
- END
- #endif
- - if (ptr!=0) strcpy(ptr,s);
- + if (ptr!=0) custom_string_copy(ptr,s);
- return ptr;
- END
- #endif
- @@ -650,7 +650,7 @@
- /*--------------------------------------------------------------------------*/
- -/* we need a strcpy() with a defined behaviour in case of overlapping source
- +/* we need a custom_string_copy() with a defined behaviour in case of overlapping source
- and destination: */
- char *strmov(char *pDest, const char *pSrc)
- @@ -659,12 +659,11 @@
- return pDest;
- }
- -#ifdef __GNUC__
- #ifdef strcpy
- # undef strcpy
- #endif
- -char *strcpy(char *pDest, const char *pSrc)
- +char* custom_string_copy_func(char* pDest, const char* pSrc, const char* file, const int line)
- {
- int l = strlen(pSrc) + 1;
- int Overlap = 0;
- @@ -685,13 +684,12 @@
- }
- if (Overlap)
- - fprintf(stderr, "overlapping strcpy() called from address 0x%p, resolve this address with addr2line and report to author\n",
- - __builtin_return_address(0));
- + fprintf(stderr, "overlapping custom_string_copy() called from address 0x%p (%s %d), resolve this address with addr2line and report to author\n",
- + __builtin_return_address(0), file, line);
- return strmov(pDest, pSrc);
- }
- -#endif
- /*--------------------------------------------------------------------------*/
- diff -uN asl-current/strutil.h asl-newest/strutil.h
- --- asl-current/strutil.h 2010-04-17 10:14:24.000000000 -0300
- +++ asl-newest/strutil.h 2013-12-18 21:08:58.355284819 -0200
- @@ -16,7 +16,7 @@
- /*****************************************************************************
- * $Log: strutil.h,v $
- * Revision 1.7 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.6 2008/11/23 10:39:17 alfred
- * - allow strings with NUL characters
- @@ -101,6 +101,10 @@
- extern void strutil_init(void);
- +#define custom_string_copy(first, second) custom_string_copy_func(first, second, __FILE__, __LINE__)
- +
- +extern char* custom_string_copy_func(char* pDest, const char* pSrc, const char* file, const int line);
- +
- /* avoid nasty "subscript has type char..." messages on some platforms */
- #define __chartouint(c) (((unsigned int)(c)) & 0xff)
- diff -uN asl-current/sysdefs.h asl-newest/sysdefs.h
- --- asl-current/sysdefs.h 2012-11-28 18:47:29.000000000 -0200
- +++ asl-newest/sysdefs.h 2013-12-18 21:08:58.355284819 -0200
- @@ -1203,6 +1203,30 @@
- #endif
- /*===========================================================================*/
- +/* Apple OSX */
- +
- +#ifdef __APPLE__
- +//#define ARCHPRNAME "apple"
- +#define ARCHSYSNAME "osx"
- +#define DEFSMADE
- +#define OPENRDMODE "r"
- +#define OPENWRMODE "w"
- +#define OPENUPMODE "r+"
- +#define IEEEFLOAT
- +typedef signed char Integ8;
- +typedef unsigned char Card8;
- +typedef signed short Integ16;
- +typedef unsigned short Card16;
- +#define HAS16
- +typedef signed int Integ32;
- +typedef unsigned int Card32;
- +typedef signed long long Integ64;
- +typedef unsigned long long Card64;
- +#define HAS64
- +#define NO_NLS
- +#endif
- +
- +/*===========================================================================*/
- /* Post-Processing: check for definition, add defaults */
- Common subdirectories: asl-current/tests and asl-newest/tests
- diff -uN asl-current/tex2doc.c asl-newest/tex2doc.c
- --- asl-current/tex2doc.c 2010-12-12 12:31:41.000000000 -0200
- +++ asl-newest/tex2doc.c 2013-12-18 21:08:58.359284819 -0200
- @@ -20,7 +20,7 @@
- * - use strmov()
- *
- * Revision 1.2 2010/08/27 14:52:43 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.1 2003/11/06 02:49:25 alfred
- * - recreated
- @@ -266,7 +266,7 @@
- sprintf(err,"undefined label '%s'",Name);
- warning(err); DoRepass=True;
- END
- - strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
- + custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
- END
- static void GetCite(char *Name, char *Dest)
- @@ -282,7 +282,7 @@
- sprintf(err,"undefined citation '%s'",Name);
- warning(err); DoRepass=True;
- END
- - strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
- + custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
- END
- static void PrintLabels(char *Name)
- @@ -329,13 +329,13 @@
- if (!c)
- {
- - strcpy(Dest, Src); *Src = '\0';
- + custom_string_copy(Dest,Src); *Src='\0';
- }
- else
- {
- *c = '\0'; strcpy(Dest , Src);
- for (c++; *c == ' '; c++);
- - strmov(Src, c);
- + custom_string_copy(Src,c);
- }
- }
- @@ -419,7 +419,7 @@
- BEGIN
- if ((CurrEnv==EnvDocument) AND (NOT DidPar))
- BEGIN
- - strcpy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
- + custom_string_copy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
- END
- END
- else if (NOT Comment) DidPar=False;
- @@ -437,7 +437,7 @@
- if (PushedTokenCnt>0)
- BEGIN
- - strcpy(Dest,PushedTokens[0].Token); strcpy(SepString,PushedTokens[0].Sep);
- + custom_string_copy(Dest,PushedTokens[0].Token); custom_string_copy(SepString,PushedTokens[0].Sep);
- for (z=0; z<PushedTokenCnt-1; z++) PushedTokens[z]=PushedTokens[z+1];
- PushedTokenCnt--;
- return True;
- @@ -504,8 +504,8 @@
- static void BackToken(char *Token)
- BEGIN
- if (PushedTokenCnt>=16) return;
- - strcpy(PushedTokens[PushedTokenCnt].Token,Token);
- - strcpy(PushedTokens[PushedTokenCnt].Sep,SepString);
- + custom_string_copy(PushedTokens[PushedTokenCnt].Token,Token);
- + custom_string_copy(PushedTokens[PushedTokenCnt].Sep,SepString);
- PushedTokenCnt++;
- END
- @@ -668,7 +668,7 @@
- save=(*search); *search='\0';
- PutLine(True); *search=save;
- for (; *search==' '; search++);
- - strcpy(OutLineBuffer,search);
- + custom_string_copy(OutLineBuffer,search);
- END
- END
- END
- @@ -946,7 +946,7 @@
- END
- else
- BEGIN
- - if (*OutLineBuffer=='\0') strcpy(OutLineBuffer," ");
- + if (*OutLineBuffer=='\0') custom_string_copy(OutLineBuffer," ");
- FlushLine();
- END
- if (CurrEnv==EnvTabbing) CurrTabStop=0;
- @@ -1070,7 +1070,7 @@
- char Line[TOKLEN],Title[TOKLEN],*run;
- PTocSave NewTocSave,RunToc;
- - strcpy(Title,OutLineBuffer); *OutLineBuffer='\0';
- + custom_string_copy(Title,OutLineBuffer); *OutLineBuffer='\0';
- run=Line;
- if (Level<3)
- @@ -1098,7 +1098,7 @@
- NewTocSave->Next=Nil;
- run=Line; run=GetSectionName(run); run+=sprintf(run," "); sprintf(run,"%s",Title);
- NewTocSave->TocName=(char *) malloc(6+Level+strlen(Line));
- - strcpy(NewTocSave->TocName,Blanks(5+Level));
- + custom_string_copy(NewTocSave->TocName,Blanks(5+Level));
- strcat(NewTocSave->TocName,Line);
- if (FirstTocSave==Nil) FirstTocSave=NewTocSave;
- else
- @@ -1510,7 +1510,7 @@
- CurrFontType=(TFontType) Index;
- assert_token("{");
- ReadToken(NToken);
- - strcpy(SepString,BackSepString);
- + custom_string_copy(SepString,BackSepString);
- BackToken(NToken);
- END
- @@ -1527,7 +1527,7 @@
- CurrFontSize=(TFontSize) Index;
- assert_token("{");
- ReadToken(NToken);
- - strcpy(SepString,BackSepString);
- + custom_string_copy(SepString,BackSepString);
- BackToken(NToken);
- END
- @@ -1682,7 +1682,7 @@
- ReadToken(Token);
- if (*SepString!='\0') error("invalid control character for \\verb");
- - Marker=(*Token); strmov(Token,Token+1); strcpy(SepString,BackSepString);
- + Marker=(*Token); strmov(Token,Token+1); custom_string_copy(SepString,BackSepString);
- do
- BEGIN
- DoAddNormal(SepString,"");
- @@ -1854,7 +1854,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -1889,7 +1889,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -1924,7 +1924,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -1959,7 +1959,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -1986,7 +1986,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -1999,8 +1999,8 @@
- UNUSED(Index);
- assert_token("{"); collect_token(Token,"}");
- - if (strcmp(Token,"c")==0) strcpy(Token,CH_ccedil);
- - if (strcmp(Token,"C")==0) strcpy(Token,CH_Ccedil);
- + if (strcmp(Token,"c")==0) custom_string_copy(Token,CH_ccedil);
- + if (strcmp(Token,"C")==0) custom_string_copy(Token,CH_Ccedil);
- DoAddNormal(Token,BackSepString);
- END
- @@ -2038,7 +2038,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)!=cnt) memmove(Line+strlen(Repl),Line+cnt,strlen(Line)-cnt+1);
- - memcpy(Line,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Line,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2072,7 +2072,7 @@
- static void TeXDoSpec(void)
- BEGIN
- - strcpy(BackSepString,SepString);
- + custom_string_copy(BackSepString,SepString);
- TeXNLS(0);
- END
- @@ -2272,11 +2272,11 @@
- BibIndent=BibCounter=0;
- GermanMode=True; SetLang(False);
- - strcpy(TocName,argv[1]);
- + custom_string_copy(TocName,argv[1]);
- if ((p=strrchr(TocName,'.'))!=Nil) *p='\0';
- strcat(TocName,".dtoc");
- - strcpy(AuxFile,argv[1]);
- + custom_string_copy(AuxFile,argv[1]);
- if ((p=strrchr(AuxFile,'.'))!=Nil) *p='\0';
- strcat(AuxFile,".daux");
- ReadAuxFile(AuxFile);
- @@ -2286,7 +2286,7 @@
- if (NOT ReadToken(Line)) break;
- if (strcmp(Line,"\\")==0)
- BEGIN
- - strcpy(BackSepString,SepString);
- + custom_string_copy(BackSepString,SepString);
- if (NOT ReadToken(Line)) error("unexpected end of file");
- if (*SepString!='\0') BackToken(Line);
- else if (NOT LookupInstTable(TeXTable,Line))
- @@ -2300,8 +2300,8 @@
- BEGIN
- if ((InMathMode=(NOT InMathMode)))
- BEGIN
- - strcpy(BackSepString,SepString);
- - ReadToken(Line); strcpy(SepString,BackSepString);
- + custom_string_copy(BackSepString,SepString);
- + ReadToken(Line); custom_string_copy(SepString,BackSepString);
- BackToken(Line);
- END
- END
- diff -uN asl-current/tex2html.c asl-newest/tex2html.c
- --- asl-current/tex2html.c 2010-08-27 11:52:43.000000000 -0300
- +++ asl-newest/tex2html.c 2013-12-18 21:08:58.359284819 -0200
- @@ -23,10 +23,10 @@
- /*****************************************************************************
- * $Log: tex2html.c,v $
- * Revision 1.4 2010/08/27 14:52:43 alfred
- - * - some more overlapping strcpy() cleanups
- + * - some more overlapping custom_string_copy() cleanups
- *
- * Revision 1.3 2010/04/17 13:14:24 alfred
- - * - address overlapping strcpy()
- + * - address overlapping custom_string_copy()
- *
- * Revision 1.2 2004/11/20 21:32:27 alfred
- * - adaptions for MinGW
- @@ -275,7 +275,7 @@
- sprintf(err,"undefined label '%s'",Name);
- warning(err); DoRepass=True;
- END
- - strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
- + custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
- END
- static void GetCite(char *Name, char *Dest)
- @@ -291,7 +291,7 @@
- sprintf(err,"undefined citation '%s'",Name);
- warning(err); DoRepass=True;
- END
- - strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
- + custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
- END
- static void PrintLabels(char *Name)
- @@ -339,11 +339,11 @@
- if (c==Nil)
- BEGIN
- - strcpy(Dest,Src); *Src='\0';
- + custom_string_copy(Dest,Src); *Src='\0';
- END
- else
- BEGIN
- - *c='\0'; strcpy(Dest,Src);
- + *c='\0'; custom_string_copy(Dest,Src);
- for (c++; *c==' '; c++);
- strmov(Src,c);
- END
- @@ -429,7 +429,7 @@
- BEGIN
- if ((CurrEnv==EnvDocument) AND (NOT DidPar))
- BEGIN
- - strcpy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
- + custom_string_copy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
- END
- END
- else if (Comment)
- @@ -454,7 +454,7 @@
- if (PushedTokenCnt>0)
- BEGIN
- - strcpy(Dest,PushedTokens[0].Token); strcpy(SepString,PushedTokens[0].Sep);
- + custom_string_copy(Dest,PushedTokens[0].Token); custom_string_copy(SepString,PushedTokens[0].Sep);
- for (z=0; z<PushedTokenCnt-1; z++) PushedTokens[z]=PushedTokens[z+1];
- PushedTokenCnt--;
- return True;
- @@ -521,8 +521,8 @@
- static void BackToken(char *Token)
- BEGIN
- if (PushedTokenCnt>=16) return;
- - strcpy(PushedTokens[PushedTokenCnt].Token,Token);
- - strcpy(PushedTokens[PushedTokenCnt].Sep,SepString);
- + custom_string_copy(PushedTokens[PushedTokenCnt].Token,Token);
- + custom_string_copy(PushedTokens[PushedTokenCnt].Sep,SepString);
- PushedTokenCnt++;
- END
- @@ -740,7 +740,7 @@
- BEGIN
- char erg[10];
- - strcpy(erg,"<");
- + custom_string_copy(erg,"<");
- if (FontNormalSize==Type) return;
- if (NOT On) strcat(erg,"/");
- @@ -1023,7 +1023,7 @@
- END
- else
- BEGIN
- - if (*OutLineBuffer=='\0') strcpy(OutLineBuffer," ");
- + if (*OutLineBuffer=='\0') custom_string_copy(OutLineBuffer," ");
- AddLine("<BR>",""); FlushLine();
- END
- END
- @@ -1150,7 +1150,7 @@
- int Level=LastLevel;
- char Line[TOKLEN],Title[TOKLEN],Ref[TOKLEN],*run,*rep;
- - strcpy(Title,OutLineBuffer); *OutLineBuffer='\0';
- + custom_string_copy(Title,OutLineBuffer); *OutLineBuffer='\0';
- fprintf(outfile, "<H%d>", Level + 1);
- @@ -1648,7 +1648,7 @@
- TeXNewFontType(Index);
- assert_token("{");
- ReadToken(NToken);
- - strcpy(SepString,BackSepString);
- + custom_string_copy(SepString,BackSepString);
- BackToken(NToken);
- END
- @@ -1665,7 +1665,7 @@
- TeXNewFontSize(Index);
- assert_token("{");
- ReadToken(NToken);
- - strcpy(SepString,BackSepString);
- + custom_string_copy(SepString,BackSepString);
- BackToken(NToken);
- END
- @@ -1839,7 +1839,7 @@
- ReadToken(Token);
- if (*SepString!='\0') error("invalid control character for \\verb");
- - Marker=(*Token); strmov(Token,Token+1); strcpy(SepString,BackSepString);
- + Marker=(*Token); strmov(Token,Token+1); custom_string_copy(SepString,BackSepString);
- do
- BEGIN
- DoAddNormal(SepString,"");
- @@ -1970,11 +1970,11 @@
- BEGIN
- if (strncmp(Line,BiblioName,strlen(BiblioName))==0)
- BEGIN
- - strcpy(Ref,"bib"); Level=1;
- + custom_string_copy(Ref,"bib"); Level=1;
- END
- else if (strncmp(Line,IndexName,strlen(IndexName))==0)
- BEGIN
- - strcpy(Ref,"index"); Level=1;
- + custom_string_copy(Ref,"index"); Level=1;
- END
- else
- BEGIN
- @@ -2079,7 +2079,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2114,7 +2114,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2149,7 +2149,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2184,7 +2184,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2211,7 +2211,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
- - memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2224,8 +2224,8 @@
- UNUSED(Index);
- assert_token("{"); collect_token(Token,"}");
- - if (strcmp(Token,"c")==0) strcpy(Token,"ç");
- - if (strcmp(Token,"C")==0) strcpy(Token,"Ç");
- + if (strcmp(Token,"c")==0) custom_string_copy(Token,"ç");
- + if (strcmp(Token,"C")==0) custom_string_copy(Token,"Ç");
- DoAddNormal(Token,BackSepString);
- END
- @@ -2263,7 +2263,7 @@
- if (Found)
- BEGIN
- if (strlen(Repl)!=cnt) memmove(Line+strlen(Repl),Line+cnt,strlen(Line)-cnt+1);
- - memcpy(Line,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
- + memcpy(Line,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
- END
- else DoAddNormal("\"",BackSepString);
- @@ -2295,7 +2295,7 @@
- SaveFont();
- TeXNewFontType(FontSuper);
- ReadToken(Token);
- - strcpy(SepString,BackSepString);
- + custom_string_copy(SepString,BackSepString);
- BackToken(Token);
- END
- else
- @@ -2307,7 +2307,7 @@
- static void TeXDoSpec(void)
- BEGIN
- - strcpy(BackSepString,SepString);
- + custom_string_copy(BackSepString,SepString);
- TeXNLS(0);
- END
- @@ -2561,11 +2561,11 @@
- /* open help files */
- - strcpy(TocName,argv[1]);
- + custom_string_copy(TocName,argv[1]);
- if ((p=strrchr(TocName,'.'))!=Nil) *p='\0';
- strcat(TocName,".htoc");
- - strcpy(AuxFile,argv[1]);
- + custom_string_copy(AuxFile,argv[1]);
- if ((p=strrchr(AuxFile,'.'))!=Nil) *p='\0';
- strcat(AuxFile,".haux");
- ReadAuxFile(AuxFile);
- @@ -2611,7 +2611,7 @@
- if (NOT ReadToken(Line)) break;
- if (strcmp(Line,"\\")==0)
- BEGIN
- - strcpy(BackSepString,SepString);
- + custom_string_copy(BackSepString,SepString);
- if (NOT ReadToken(Line)) error("unexpected end of file");
- if (*SepString!='\0') BackToken(Line);
- else if (NOT LookupInstTable(TeXTable,Line))
- @@ -2625,8 +2625,8 @@
- BEGIN
- if ((InMathMode=(NOT InMathMode)))
- BEGIN
- - strcpy(BackSepString,SepString);
- - ReadToken(Line); strcpy(SepString,BackSepString);
- + custom_string_copy(BackSepString,SepString);
- + ReadToken(Line); custom_string_copy(SepString,BackSepString);
- BackToken(Line);
- END
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement