Guest User

ASL for Linux

a guest
Dec 18th, 2013
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -uN asl-current/a2k.c asl-newest/a2k.c
  2. --- asl-current/a2k.c   1997-11-18 05:25:55.000000000 -0200
  3. +++ asl-newest/a2k.c    2013-12-18 21:08:58.207284813 -0200
  4. @@ -73,7 +73,7 @@
  5.       if (BUFFERSIZE==BufferFill)
  6.        {
  7.         fprintf(outfile,"%s\n",lines[0]);
  8. -       for (z=0; z<BufferFill; z++) strcpy(lines[z],lines[z+1]);
  9. +       for (z=0; z<BufferFill; z++) custom_string_copy(lines[z],lines[z+1]);
  10.         BufferFill--;
  11.        }
  12.       readline(inpfile,lines[BufferFill++]);
  13. @@ -103,7 +103,7 @@
  14.         /* cut function name+prefixes: parameter list starts at first '(' */
  15.  
  16.         p=strchr(orig,'('); *p='\0';
  17. -       sprintf(dest,"\t%s",orig); strcat(dest,"("); strcpy(orig,p+1);
  18. +       sprintf(dest,"\t%s",orig); strcat(dest,"("); custom_string_copy(orig,p+1);
  19.  
  20.         /* cut trailing ')' */
  21.  
  22. @@ -117,15 +117,15 @@
  23.           p=strchr(orig,',');
  24.           if (p==NULL)
  25.            {
  26. -           strcpy(single,orig); *orig='\0';
  27. +           custom_string_copy(single,orig); *orig='\0';
  28.            }
  29.           else
  30.            {
  31. -           *p='\0'; strcpy(single,orig); strcpy(orig,p+1);
  32. +           *p='\0'; custom_string_copy(single,orig); custom_string_copy(orig,p+1);
  33.            }
  34. -         for (p=single; isspace(*p); p++); strcpy(single,p);
  35. +         for (p=single; isspace(*p); p++); custom_string_copy(single,p);
  36.           for (p=single+strlen(single)-1; isspace(*p); p--); p[1]='\0';
  37. -         if (strncmp(single,"const ",6)==0) strcpy(single,single+6);
  38. +         if (strncmp(single,"const ",6)==0) custom_string_copy(single,single+6);
  39.           if (strcmp(single,"void")!=0)
  40.            {
  41.             strcat(params,single); strcat(params,";\n");
  42. @@ -169,7 +169,7 @@
  43.              flush line buffer before. */
  44.  
  45.           save=p[1];
  46. -         p[1]='\0'; strcpy(dest,lines[BufferFill-1]); strcat(dest,");");
  47. +         p[1]='\0'; custom_string_copy(dest,lines[BufferFill-1]); strcat(dest,");");
  48.           p[1]=save;
  49.  
  50.           for (z=0; z<BufferFill-1; fprintf(outfile,"%s\n",lines[z++]));
  51. @@ -177,7 +177,7 @@
  52.          
  53.           /* discard lines until end of prototype */
  54.  
  55. -         strcpy(dest,lines[BufferFill-1]); BufferFill=0;
  56. +         custom_string_copy(dest,lines[BufferFill-1]); BufferFill=0;
  57.           while (strcmp(dest+strlen(dest)-2,");")!=0)
  58.            {
  59.             readline(inpfile,dest);
  60. diff -uN asl-current/as.c asl-newest/as.c
  61. --- asl-current/as.c    2013-03-09 13:15:07.000000000 -0300
  62. +++ asl-newest/as.c 2013-12-18 21:11:20.131290696 -0200
  63. @@ -77,7 +77,7 @@
  64.   * - add some platforms
  65.   *
  66.   * Revision 1.22  2010/04/17 13:14:18  alfred
  67. - * - address overlapping strcpy()
  68. + * - address overlapping custom_string_copy()
  69.   *
  70.   * Revision 1.21  2010/02/27 14:17:26  alfred
  71.   * - correct increment/decrement of macro nesting level
  72. @@ -717,7 +717,7 @@
  73.     Lauf = PInp->Lines;
  74.     for (z = 1; z <= PInp->LineZ - 1; z++)
  75.      Lauf = Lauf->Next;
  76. -   strcpy(erg, Lauf->Content);
  77. +   custom_string_copy(erg, Lauf->Content);
  78.  
  79.     /* process parameters */
  80.  
  81. @@ -1140,7 +1140,7 @@
  82.  
  83.    /* extract line */
  84.  
  85. -  strcpy(erg, PInp->LineRun->Content);
  86. +  custom_string_copy(erg, PInp->LineRun->Content);
  87.    PInp->LineRun = PInp->LineRun->Next;
  88.  
  89.    /* expand iteration parameter */
  90. @@ -1404,7 +1404,7 @@
  91.  
  92.    /* extract line */
  93.  
  94. -  strcpy(erg, PInp->LineRun->Content);
  95. +  custom_string_copy(erg, PInp->LineRun->Content);
  96.    PInp->LineRun = PInp->LineRun->Next;
  97.  
  98.    /* extract iteration parameter */
  99. @@ -1577,7 +1577,7 @@
  100.  
  101.    /* extract line */
  102.  
  103. -  strcpy(erg, PInp->LineRun->Content);
  104. +  custom_string_copy(erg, PInp->LineRun->Content);
  105.    PInp->LineRun = PInp->LineRun->Next;
  106.  
  107.    /* last line of body? Then increment count and stop if last iteration */
  108. @@ -1777,7 +1777,7 @@
  109.    {
  110.      /* get line of body */
  111.  
  112. -    strcpy(erg, PInp->LineRun->Content);
  113. +    custom_string_copy(erg, PInp->LineRun->Content);
  114.      PInp->LineRun = PInp->LineRun->Next;
  115.  
  116.      /* in case this is the last line of the body, reset counters */
  117. @@ -2134,7 +2134,7 @@
  118.       {
  119.         Last = RunTag->GetPos(RunTag, ActPos);
  120.         tmppos = (char *) malloc(strlen(ErgPos) + strlen(ActPos) + 1);
  121. -       strcpy(tmppos, ActPos); strcat(tmppos, ErgPos);
  122. +       custom_string_copy(tmppos, ActPos); strcat(tmppos, ErgPos);
  123.         free(ErgPos); ErgPos = tmppos;
  124.         if (Last) break;
  125.       }
  126. @@ -2239,7 +2239,7 @@
  127.      BEGIN
  128.       SearchMacros=True; ExpandSymbol(OpPart);
  129.      END
  130. -   strcpy(LOpPart,OpPart); NLS_UpString(OpPart);
  131. +   custom_string_copy(LOpPart,OpPart); NLS_UpString(OpPart);
  132.  
  133.     /* Prozessor eingehaengt ? */
  134.  
  135. @@ -2423,7 +2423,7 @@
  136.     strmaxcpy(h,OneLine,255); i=QuotPos(h,';');
  137.     if (i!=Nil)
  138.      BEGIN  
  139. -     strcpy(CommPart,i+1);
  140. +     custom_string_copy(CommPart,i+1);
  141.       *i='\0';
  142.      END
  143.     else *CommPart='\0';
  144. @@ -2441,11 +2441,11 @@
  145.           break;
  146.       if (!*i)
  147.       {
  148. -       strcpy(LabPart, h); *h = '\0';
  149. +       custom_string_copy(LabPart, h); *h = '\0';
  150.       }
  151.       else
  152.       {
  153. -       *i = '\0'; strcpy(LabPart, h); strmov(h, i + 1);
  154. +       *i = '\0'; custom_string_copy(LabPart, h); strmov(h, i + 1);
  155.       }
  156.       if (LabPart[l = (strlen(LabPart) - 1)] == ':')
  157.         LabPart[l] = '\0';
  158. @@ -2465,10 +2465,10 @@
  159.     i=strchr(OpPart,':');
  160.     if ((*LabPart=='\0') AND (i!=Nil) AND (i[1]=='\0'))
  161.      BEGIN
  162. -     *i='\0'; strcpy(LabPart,OpPart); strcpy(OpPart,i+1);
  163. +     *i='\0'; custom_string_copy(LabPart,OpPart); custom_string_copy(OpPart,i+1);
  164.       if (*OpPart=='\0')
  165.        BEGIN
  166. -       strcpy(h,ArgPart);
  167. +       custom_string_copy(h,ArgPart);
  168.         longjmp(Retry,1);
  169.        END
  170.      END
  171. @@ -2500,7 +2500,7 @@
  172.  
  173.     /* Argumente zerteilen: Da alles aus einem String kommt und die Teile alle auch
  174.        so lang sind, koennen wir uns Laengenabfragen sparen */
  175. -   ArgCnt=0; strcpy(h,ArgPart); run=h;
  176. +   ArgCnt=0; custom_string_copy(h,ArgPart); run=h;
  177.     if (*run!='\0')
  178.      do
  179.       BEGIN
  180. @@ -2513,7 +2513,7 @@
  181.         END
  182.        lpos=((i!=Nil) AND (i[1]=='\0'));
  183.        if (i!=Nil) *i='\0';
  184. -      strcpy(ArgStr[++ArgCnt],run);
  185. +      custom_string_copy(ArgStr[++ArgCnt],run);
  186.        if ((lpos) AND (ArgCnt!=ParMax)) *ArgStr[++ArgCnt]='\0';
  187.        KillPostBlanks(ArgStr[ArgCnt]);
  188.        run=(i==Nil) ? i : i+1;
  189. @@ -3093,20 +3093,20 @@
  190.       WrLstLine("");
  191.      END
  192.  
  193. -   strcpy(s,Dec32BlankString(LineSum,7));
  194. +   custom_string_copy(s,Dec32BlankString(LineSum,7));
  195.     strmaxcat(s,getmessage((LineSum==1)?Num_InfoMessAssLine:Num_InfoMessAssLines),255);
  196.     if (NOT QuietMode) printf("%s%s\n",s,ClrEol);
  197.     if (ListMode==2) WrLstLine(s);
  198.  
  199.     if (LineSum!=MacLineSum)
  200.      BEGIN
  201. -     strcpy(s,Dec32BlankString(MacLineSum,7));
  202. +     custom_string_copy(s,Dec32BlankString(MacLineSum,7));
  203.       strmaxcat(s,getmessage((MacLineSum==1)?Num_InfoMessMacAssLine:Num_InfoMessMacAssLines),255);
  204.       if (NOT QuietMode) printf("%s%s\n",s,ClrEol);
  205.       if (ListMode==2) WrLstLine(s);
  206.      END
  207.  
  208. -   strcpy(s,Dec32BlankString(PassNo,7));
  209. +   custom_string_copy(s,Dec32BlankString(PassNo,7));
  210.     strmaxcat(s,getmessage((PassNo==1)?Num_InfoMessPassCnt:Num_InfoMessPPassCnt),255);
  211.     if (NOT QuietMode) printf("%s%s\n",s,ClrEol);
  212.     if (ListMode==2) WrLstLine(s);
  213. @@ -3492,7 +3492,7 @@
  214.        END
  215.       else
  216.        BEGIN
  217. -       *p='\0'; strmaxcpy(Part,Copy,255); strcpy(Copy,p+1);
  218. +       *p='\0'; strmaxcpy(Part,Copy,255); custom_string_copy(Copy,p+1);
  219.        END
  220.      if (NOT CaseSensitive)
  221.       UpString(Part);
  222. @@ -3503,7 +3503,7 @@
  223.       END
  224.      else
  225.       BEGIN
  226. -      *p='\0'; strmaxcpy(Name,Part,255); strcpy(Part,p+1);
  227. +      *p='\0'; strmaxcpy(Name,Part,255); custom_string_copy(Part,p+1);
  228.       END
  229.      if (NOT ChkSymbName(Name)) return CMDErr;
  230.      if (Negate) RemoveDefSymbol(Name);
  231. @@ -3843,8 +3843,8 @@
  232.         END
  233.        else
  234.         BEGIN
  235. -        strcpy(ClrEol," [K"); ClrEol[0]=Char_ESC;  /* ANSI-Sequenzen */
  236. -        strcpy(CursUp," [A"); CursUp[0]=Char_ESC;
  237. +        custom_string_copy(ClrEol," [K"); ClrEol[0]=Char_ESC;  /* ANSI-Sequenzen */
  238. +        custom_string_copy(CursUp," [A"); CursUp[0]=Char_ESC;
  239.         END
  240.        break;
  241.       case RedirToDevice:
  242. @@ -3853,7 +3853,7 @@
  243.        for (i=1; i<=20; i++) strcat(ClrEol,"\b");
  244.        break;
  245.       case RedirToFile:
  246. -      strcpy(ClrEol,"\n");  /* CRLF auf Datei */
  247. +      custom_string_copy(ClrEol,"\n");  /* CRLF auf Datei */
  248.      END
  249.  
  250.     ShareMode = 0; ListMode = 0; IncludeList[0] = '\0'; SuppWarns = False;
  251. @@ -3861,7 +3861,7 @@
  252.     MakeIncludeList = False; ListMask = 0x1ff;
  253.     MakeDebug = False; ExtendErrors = 0;
  254.     MacroOutput = False; MacProOutput = False; CodeOutput = True;
  255. -   strcpy(ErrorPath, "!2"); MsgIfRepass = False; QuietMode = False;
  256. +   custom_string_copy(ErrorPath, "!2"); MsgIfRepass = False; QuietMode = False;
  257.     NumericErrors = False; DebugMode = DebugNone; CaseSensitive = False;
  258.     ThrowErrors = False; HardRanges = True;
  259.     NoICEMask = 1 << SegCode;
  260. @@ -3896,7 +3896,7 @@
  261.     GlobErrFlag=False;
  262.     if (ErrorPath[0]!='\0')
  263.      BEGIN
  264. -     strcpy(ErrorName,ErrorPath);
  265. +     custom_string_copy(ErrorName,ErrorPath);
  266.       unlink(ErrorName);
  267.      END
  268.     IsErrorOpen=False;
  269. diff -uN asl-current/asmallg.c asl-newest/asmallg.c
  270. --- asl-current/asmallg.c   2012-05-26 10:49:19.000000000 -0300
  271. +++ asl-newest/asmallg.c    2013-12-18 21:08:58.215284813 -0200
  272. @@ -35,10 +35,10 @@
  273.   * - regard symbol name expansion in arguments for SHARED
  274.   *
  275.   * Revision 1.9  2010/08/27 14:52:41  alfred
  276. - * - some more overlapping strcpy() cleanups
  277. + * - some more overlapping custom_string_copy() cleanups
  278.   *
  279.   * Revision 1.8  2010/04/17 13:14:19  alfred
  280. - * - address overlapping strcpy()
  281. + * - address overlapping custom_string_copy()
  282.   *
  283.   * Revision 1.7  2008/11/23 10:39:15  alfred
  284.   * - allow strings with NUL characters
  285. diff -uN asl-current/asmif.c asl-newest/asmif.c
  286. --- asl-current/asmif.c 2010-08-27 11:52:41.000000000 -0300
  287. +++ asl-newest/asmif.c  2013-12-18 21:08:58.219284813 -0200
  288. @@ -11,7 +11,7 @@
  289.  /*****************************************************************************
  290.   * $Log: asmif.c,v $
  291.   * Revision 1.4  2010/08/27 14:52:41  alfred
  292. - * - some more overlapping strcpy() cleanups
  293. + * - some more overlapping custom_string_copy() cleanups
  294.   *
  295.   * Revision 1.3  2008/11/23 10:39:15  alfred
  296.   * - allow strings with NUL characters
  297. diff -uN asl-current/asmpars.c asl-newest/asmpars.c
  298. --- asl-current/asmpars.c   2013-03-09 13:15:08.000000000 -0300
  299. +++ asl-newest/asmpars.c    2013-12-18 21:08:58.223284813 -0200
  300. @@ -43,7 +43,7 @@
  301.   * - add NEC 75xx
  302.   *
  303.   * Revision 1.19  2010/04/17 13:14:19  alfred
  304. - * - address overlapping strcpy()
  305. + * - address overlapping custom_string_copy()
  306.   *
  307.   * Revision 1.18  2010/03/07 11:16:53  alfred
  308.   * - allow DC.(float) on string operands
  309. @@ -499,7 +499,7 @@
  310.     while (p!=Nil)
  311.      BEGIN
  312.       n=p+1; if (ProcessBk(&n,&ErgChar)) *p=ErgChar;
  313. -     strcpy(p+1,n);
  314. +     custom_string_copy(p+1,n);
  315.       p=strchr(p+1,'\\');
  316.      END
  317.  END
  318. @@ -520,7 +520,7 @@
  319.         WrXError(1020,Name);
  320.         return False;
  321.        END
  322. -     strcpy(p1,p2+1); *p2='\0';
  323. +     custom_string_copy(p1,p2+1); *p2='\0';
  324.       FirstPassUnknown=False;
  325.       EvalStringExpression(h,&OK,h);
  326.       if (FirstPassUnknown)
  327. @@ -584,7 +584,7 @@
  328.  
  329.      if (*TmpSymCounterVal == '\0')
  330.       sprintf(TmpSymCounterVal, "%d", TmpSymCounter);
  331. -    strcpy(Dest, TmpSymCounterVal);
  332. +    custom_string_copy(Dest, TmpSymCounterVal);
  333.      Result = TRUE;
  334.    }
  335.  
  336. @@ -1899,7 +1899,17 @@
  337.           if (!KlPos)
  338.             Copy[0] = '\0';
  339.           else
  340. -           strcpy(Copy, KlPos + 1);
  341. +         {
  342. +           const size_t copyLen = strlen(KlPos+1) + 1;
  343. +           char* buffer = malloc(copyLen);
  344. +           memset(buffer, 0, copyLen);
  345. +           strcpy(buffer, KlPos+1);
  346. +          
  347. +           custom_string_copy(Copy, buffer);
  348. +          
  349. +           free (buffer);
  350. +           //  custom_string_copy(Copy, KlPos + 1); // overlap here
  351. +         }
  352.  
  353.           strmaxcpy(stemp, "(", 255);
  354.           switch (LVal.Typ)
  355. @@ -4156,7 +4166,7 @@
  356.     if (SymbolEntry->RefList==Nil) return;
  357.  
  358.     ConvertSymbolVal(&(SymbolEntry->SymWert),&t);
  359. -   strcpy(h," (=");
  360. +   custom_string_copy(h," (=");
  361.     StrSym(&t, False, h2, sizeof(h2));
  362.     strmaxcat(h,h2,255);
  363.     strmaxcat(h,",",255);
  364. @@ -4183,12 +4193,12 @@
  365.  
  366.       if (Lauf!=Nil)
  367.       {
  368. -       strcpy(h," ");
  369. +       custom_string_copy(h," ");
  370.         strmaxcat(h,getmessage(Num_ListCrossFileName),255);
  371.         strmaxcat(h,GetFileName(FileZ),255);
  372.         strmaxcat(h," :",255);
  373.         WrLstLine(h);
  374. -       strcpy(LineAcc,"   ");
  375. +       custom_string_copy(LineAcc,"   ");
  376.         while (Lauf!=Nil)
  377.         {
  378.           sprintf(LinePart,"%5ld", (long)Lauf->LineNum);
  379. @@ -4201,7 +4211,7 @@
  380.           else strmaxcat(LineAcc,"    ",255);
  381.           if (strlen(LineAcc)>=72)
  382.           {
  383. -           WrLstLine(LineAcc); strcpy(LineAcc,"  ");
  384. +           WrLstLine(LineAcc); custom_string_copy(LineAcc,"  ");
  385.           }
  386.           Lauf=Lauf->Next;
  387.         }
  388. @@ -4438,7 +4448,7 @@
  389.       else
  390.        BEGIN
  391.         strmaxcat(tmp,Blanks(cwidth-3-strlen(tmp)),255);
  392. -       if (*buf=='\0') strcpy(buf,tmp);
  393. +       if (*buf=='\0') custom_string_copy(buf,tmp);
  394.         else
  395.          BEGIN
  396.           strcat(buf," | "); strcat(buf,tmp);
  397. diff -uN asl-current/asmsub.c asl-newest/asmsub.c
  398. --- asl-current/asmsub.c    2012-08-22 17:01:45.000000000 -0300
  399. +++ asl-newest/asmsub.c 2013-12-18 21:08:58.223284813 -0200
  400. @@ -42,7 +42,7 @@
  401.   * - use strmov()
  402.   *
  403.   * Revision 1.12  2010/04/17 13:14:19  alfred
  404. - * - address overlapping strcpy()
  405. + * - address overlapping custom_string_copy()
  406.   *
  407.   * Revision 1.11  2008/11/23 10:39:16  alfred
  408.   * - allow strings with NUL characters
  409. @@ -914,7 +914,7 @@
  410.  
  411.     *h = '\0';
  412.     if (!GNUErrors)
  413. -     strcpy(h,"> > >");
  414. +     custom_string_copy(h,"> > >");
  415.     p = GetErrorPos();
  416.     if (p[l = strlen(p) - 1] == ' ')
  417.       p[l] = '\0';
  418. @@ -1323,7 +1323,7 @@
  419.        sprintf(s,"  %s%s%s",getmessage(Num_ListSegListHead1),SegNames[z],
  420.                             getmessage(Num_ListSegListHead2));
  421.        WrLstLine(s);
  422. -      strcpy(s,"  ");
  423. +      custom_string_copy(s,"  ");
  424.        l=strlen(SegNames[z])+strlen(getmessage(Num_ListSegListHead1))+strlen(getmessage(Num_ListSegListHead2));
  425.        for (z2=0; z2<l; z2++) strmaxcat(s,"-",255);
  426.        WrLstLine(s);
  427. @@ -1733,10 +1733,10 @@
  428.      BEGIN
  429.       strmaxcpy(MemVal,MemFlag,255);
  430.       p=strchr(MemVal,',');
  431. -     if (p==Nil) strcpy(TempName,"ASX.TMP");
  432. +     if (p==Nil) custom_string_copy(TempName,"ASX.TMP");
  433.       else
  434.        BEGIN
  435. -       *p=Nil; strcpy(TempName,MemVal);
  436. +       *p=Nil; custom_string_copy(TempName,MemVal);
  437.         strmov(MemVal,p+1);
  438.        END;
  439.       KillBlanks(TempName); KillBlanks(MemVal);
  440. diff -uN asl-current/bpemu.c asl-newest/bpemu.c
  441. --- asl-current/bpemu.c 2010-05-01 14:06:35.000000000 -0300
  442. +++ asl-newest/bpemu.c  2013-12-18 21:08:58.227284813 -0200
  443. @@ -235,7 +235,7 @@
  444.      BEGIN
  445.       if ((blk.ff_attrib&(FA_LABEL|FA_DIREC))==0)
  446.        BEGIN
  447. -       strcpy(Name+(pos-Mask),blk.ff_name);
  448. +       custom_string_copy(Name+(pos-Mask),blk.ff_name);
  449.         callback(Name);
  450.        END
  451.       res=findnext(&blk);
  452. @@ -256,7 +256,7 @@
  453.     memcpy(Name,Mask,pos-Mask);
  454.     while (res==0)
  455.      BEGIN
  456. -     strcpy(Name+(pos-Mask),buf.achName); callback(Name);
  457. +     custom_string_copy(Name+(pos-Mask),buf.achName); callback(Name);
  458.       res=DosFindNext(hdir,&buf,sizeof(buf),&rescnt);
  459.      END
  460.     return True;
  461. diff -uN asl-current/changelog asl-newest/changelog
  462. --- asl-current/changelog   2013-08-07 16:44:37.000000000 -0300
  463. +++ asl-newest/changelog    2013-12-18 21:08:58.227284813 -0200
  464. @@ -1201,7 +1201,7 @@
  465.  
  466.  2010-04-17 [Bld77]
  467.  
  468. -- Bugfix      : address problem of overlapping strcpy()
  469. +- Bugfix      : address problem of overlapping custom_string_copy()
  470.  
  471.  2010-06-14 [Bld78]
  472.  
  473. diff -uN asl-current/code166.c asl-newest/code166.c
  474. --- asl-current/code166.c   2010-12-05 21:17:59.000000000 -0200
  475. +++ asl-newest/code166.c    2013-12-18 21:08:58.227284813 -0200
  476. @@ -17,10 +17,10 @@
  477.   * - use machine-dependent SFR start when transforming SFR addresses back to absolute
  478.   *
  479.   * Revision 1.7  2010/08/27 14:52:41  alfred
  480. - * - some more overlapping strcpy() cleanups
  481. + * - some more overlapping custom_string_copy() cleanups
  482.   *
  483.   * Revision 1.6  2010/04/17 13:14:19  alfred
  484. - * - address overlapping strcpy()
  485. + * - address overlapping custom_string_copy()
  486.   *
  487.   * Revision 1.5  2007/11/24 22:48:03  alfred
  488.   * - some NetBSD changes
  489. diff -uN asl-current/code17c4x.c asl-newest/code17c4x.c
  490. --- asl-current/code17c4x.c 2008-11-23 08:39:16.000000000 -0200
  491. +++ asl-newest/code17c4x.c  2013-12-18 21:08:58.227284813 -0200
  492. @@ -412,9 +412,9 @@
  493.        BEGIN
  494.         if (Memo("MOVFP"))
  495.          BEGIN
  496. -         strcpy(ArgStr[3],ArgStr[1]);
  497. -         strcpy(ArgStr[1],ArgStr[2]);
  498. -         strcpy(ArgStr[2],ArgStr[3]);
  499. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  500. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  501. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  502.          END
  503.         AdrWord=EvalIntExpression(ArgStr[1],UInt5,&OK);
  504.         if (OK)
  505. diff -uN asl-current/code2650.c asl-newest/code2650.c
  506. --- asl-current/code2650.c  2013-02-14 18:48:57.000000000 -0200
  507. +++ asl-newest/code2650.c   2013-12-18 21:08:58.227284813 -0200
  508. @@ -535,8 +535,8 @@
  509.      int ArgC;
  510.  
  511.      for (ArgC = ArgCnt; ArgC >= 1; ArgC--)
  512. -      strcpy(ArgStr[ArgC + 1], ArgStr[ArgC]);
  513. -    strcpy(ArgStr[1], pPos + 1);
  514. +      custom_string_copy(ArgStr[ArgC + 1], ArgStr[ArgC]);
  515. +    custom_string_copy(ArgStr[1], pPos + 1);
  516.      *pPos = '\0';
  517.      ArgCnt++;
  518.    }
  519. diff -uN asl-current/code3203x.c asl-newest/code3203x.c
  520. --- asl-current/code3203x.c 2010-04-17 10:14:19.000000000 -0300
  521. +++ asl-newest/code3203x.c  2013-12-18 21:08:58.227284813 -0200
  522. @@ -15,7 +15,7 @@
  523.  /*****************************************************************************
  524.   * $Log: code3203x.c,v $
  525.   * Revision 1.6  2010/04/17 13:14:19  alfred
  526. - * - address overlapping strcpy()
  527. + * - address overlapping custom_string_copy()
  528.   *
  529.   * Revision 1.5  2008/11/23 10:39:16  alfred
  530.   * - allow strings with NUL characters
  531. @@ -944,7 +944,7 @@
  532.         BEGIN
  533.          if (GenOrders[z].May1)
  534.           BEGIN
  535. -          ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
  536. +          ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
  537.           END
  538.          else
  539.           BEGIN
  540. @@ -955,13 +955,13 @@
  541.        Is3=(OpPart[strlen(OpPart)-1]=='3');
  542.        if ((GenOrders[z].SwapOps) AND (NOT Is3))
  543.         BEGIN
  544. -        strcpy(ArgStr[3],ArgStr[1]);
  545. -        strcpy(ArgStr[1],ArgStr[2]);
  546. -        strcpy(ArgStr[2],ArgStr[3]);
  547. +        custom_string_copy(ArgStr[3],ArgStr[1]);
  548. +        custom_string_copy(ArgStr[1],ArgStr[2]);
  549. +        custom_string_copy(ArgStr[2],ArgStr[3]);
  550.         END
  551.        if ((Is3) AND (ArgCnt==2))
  552.         BEGIN
  553. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]);
  554. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]);
  555.         END
  556.        if ((ArgCnt<2) OR (ArgCnt>3) OR ((Is3) AND (NOT GenOrders[z].May3)))
  557.         BEGIN
  558. @@ -1189,7 +1189,7 @@
  559.          PrevSrc1Mode=CurrSrc1Mode; PrevSrc1Part=CurrSrc1Part;
  560.          PrevSrc2Mode=CurrSrc2Mode; PrevSrc2Part=CurrSrc2Part;
  561.          PrevDestMode=CurrDestMode; PrevDestPart=CurrDestPart;
  562. -        strcpy(PrevOp,OpPart); PrevARs=ARs; z2=z;
  563. +        custom_string_copy(PrevOp,OpPart); PrevARs=ARs; z2=z;
  564.          if (Is3)
  565.           DAsmCode[0]=0x20000000+(((LongWord)GenOrders[z].Code3) << 23)
  566.                      +(((LongWord)CurrDestPart) << 16)
  567. @@ -1236,7 +1236,7 @@
  568.  
  569.     if ((strncmp(OpPart,"LDI",3)==0) OR (strncmp(OpPart,"LDF",3)==0))
  570.      BEGIN
  571. -     strcpy(HOp,OpPart); strmov(OpPart,OpPart+3);
  572. +     custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+3);
  573.       for (z=0; z<ConditionCount; z++)
  574.        if (Memo(Conditions[z].Name))
  575.         BEGIN
  576. @@ -1347,7 +1347,7 @@
  577.  
  578.     if (*OpPart=='B')
  579.      BEGIN
  580. -     strcpy(HOp,OpPart);
  581. +     custom_string_copy(HOp,OpPart);
  582.       strmov(OpPart,OpPart+1);
  583.       l=strlen(OpPart);
  584.       if ((l>=1) AND (OpPart[l-1]=='D'))
  585. @@ -1389,7 +1389,7 @@
  586.  
  587.     if (strncmp(OpPart,"CALL",4)==0)
  588.      BEGIN
  589. -     strcpy(HOp,OpPart); strmov(OpPart,OpPart+4);
  590. +     custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+4);
  591.       for (z=0; z<ConditionCount; z++)
  592.        if (Memo(Conditions[z].Name))
  593.         BEGIN
  594. @@ -1420,7 +1420,7 @@
  595.  
  596.     if (strncmp(OpPart,"DB",2)==0)
  597.      BEGIN
  598. -     strcpy(HOp,OpPart);
  599. +     custom_string_copy(HOp,OpPart);
  600.       strmov(OpPart,OpPart+2);
  601.       l=strlen(OpPart);
  602.       if ((l>=1) AND (OpPart[l-1]=='D'))
  603. @@ -1477,7 +1477,7 @@
  604.     if ((strncmp(OpPart,"RETI",4)==0) OR (strncmp(OpPart,"RETS",4)==0))
  605.      BEGIN
  606.       DFlag=(OpPart[3]=='S')?(1l << 23):(0);
  607. -     strcpy(HOp,OpPart); strmov(OpPart,OpPart+4);
  608. +     custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+4);
  609.       for (z=0; z<ConditionCount; z++)
  610.        if (Memo(Conditions[z].Name))
  611.         BEGIN
  612. @@ -1495,7 +1495,7 @@
  613.  
  614.     if (strncmp(OpPart,"TRAP",4)==0)
  615.      BEGIN
  616. -     strcpy(HOp,OpPart); strmov(OpPart,OpPart+4);
  617. +     custom_string_copy(HOp,OpPart); strmov(OpPart,OpPart+4);
  618.       for (z=0; z<ConditionCount; z++)
  619.        if (Memo(Conditions[z].Name))
  620.         BEGIN
  621. diff -uN asl-current/code3206x.c asl-newest/code3206x.c
  622. --- asl-current/code3206x.c 2010-04-17 10:14:19.000000000 -0300
  623. +++ asl-newest/code3206x.c  2013-12-18 21:08:58.231284814 -0200
  624. @@ -19,7 +19,7 @@
  625.  /*****************************************************************************
  626.   * $Log: code3206x.c,v $
  627.   * Revision 1.7  2010/04/17 13:14:19  alfred
  628. - * - address overlapping strcpy()
  629. + * - address overlapping custom_string_copy()
  630.   *
  631.   * Revision 1.6  2008/11/23 10:39:16  alfred
  632.   * - allow strings with NUL characters
  633. @@ -208,13 +208,13 @@
  634.     p=FirstBlank(ArgStr[1]);
  635.     if (p==Nil)
  636.      BEGIN
  637. -     strcpy(OpPart,ArgStr[1]);
  638. -     for (z=2; z<=ArgCnt; z++) strcpy(ArgStr[z-1],ArgStr[z]);
  639. +     custom_string_copy(OpPart,ArgStr[1]);
  640. +     for (z=2; z<=ArgCnt; z++) custom_string_copy(ArgStr[z-1],ArgStr[z]);
  641.       ArgCnt--;
  642.      END
  643.     else
  644.      BEGIN
  645. -     *p='\0'; strcpy(OpPart,ArgStr[1]); strcpy(ArgStr[1],p+1);
  646. +     *p='\0'; custom_string_copy(OpPart,ArgStr[1]); custom_string_copy(ArgStr[1],p+1);
  647.       KillPrefBlanks(ArgStr[1]);
  648.      END
  649.     NLS_UpString(OpPart);
  650. @@ -222,7 +222,7 @@
  651.     if (p==Nil) *AttrPart='\0';
  652.     else
  653.      BEGIN
  654. -     strcpy(AttrPart,p+1);
  655. +     custom_string_copy(AttrPart,p+1);
  656.       *p='\0';
  657.      END;
  658.     return True;
  659. @@ -372,7 +372,7 @@
  660.      END
  661.     else
  662.      BEGIN
  663. -     strcpy(RegPart,Asc); *DispPart='\0';
  664. +     custom_string_copy(RegPart,Asc); *DispPart='\0';
  665.      END
  666.  
  667.     /* Registerfeld entschluesseln */
  668. @@ -836,8 +836,8 @@
  669.       IsStore=(*OpPart)=='S';
  670.       if (IsStore)
  671.        BEGIN
  672. -       strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]);
  673. -       strcpy(ArgStr[2],ArgStr[3]);
  674. +       custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]);
  675. +       custom_string_copy(ArgStr[2],ArgStr[3]);
  676.         ThisStore=True;
  677.        END
  678.       if (DecodeAdr(ArgStr[2],MModReg,False,&DReg))
  679. diff -uN asl-current/code3254x.c asl-newest/code3254x.c
  680. --- asl-current/code3254x.c 2010-04-17 10:14:20.000000000 -0300
  681. +++ asl-newest/code3254x.c  2013-12-18 21:08:58.231284814 -0200
  682. @@ -35,7 +35,7 @@
  683.  /*****************************************************************************
  684.   * $Log: code3254x.c,v $
  685.   * Revision 1.6  2010/04/17 13:14:20  alfred
  686. - * - address overlapping strcpy()
  687. + * - address overlapping custom_string_copy()
  688.   *
  689.   * Revision 1.5  2007/11/24 22:48:03  alfred
  690.   * - some NetBSD changes
  691. @@ -2297,9 +2297,9 @@
  692.    {
  693.      if (Index & 0x0100)
  694.      {
  695. -      strcpy(ArgStr[3], ArgStr[1]);
  696. -      strcpy(ArgStr[1], ArgStr[2]);
  697. -      strcpy(ArgStr[2], ArgStr[3]);
  698. +      custom_string_copy(ArgStr[3], ArgStr[1]);
  699. +      custom_string_copy(ArgStr[1], ArgStr[2]);
  700. +      custom_string_copy(ArgStr[2], ArgStr[3]);
  701.      }
  702.      ForcePageZero = True;
  703.      if (DecodeAdr(ArgStr[2], MModMem))
  704. @@ -2357,9 +2357,9 @@
  705.    {
  706.      if (Index & 0x0100)
  707.      {
  708. -      strcpy(ArgStr[3], ArgStr[1]);
  709. -      strcpy(ArgStr[1], ArgStr[2]);
  710. -      strcpy(ArgStr[2], ArgStr[3]);
  711. +      custom_string_copy(ArgStr[3], ArgStr[1]);
  712. +      custom_string_copy(ArgStr[1], ArgStr[2]);
  713. +      custom_string_copy(ArgStr[2], ArgStr[3]);
  714.      }
  715.      if (DecodeAdr(ArgStr[2], MModMem))
  716.      {
  717. diff -uN asl-current/code370.c asl-newest/code370.c
  718. --- asl-current/code370.c   2010-04-17 10:14:20.000000000 -0300
  719. +++ asl-newest/code370.c    2013-12-18 21:08:58.231284814 -0200
  720. @@ -13,7 +13,7 @@
  721.  /*****************************************************************************
  722.   * $Log: code370.c,v $
  723.   * Revision 1.6  2010/04/17 13:14:20  alfred
  724. - * - address overlapping strcpy()
  725. + * - address overlapping custom_string_copy()
  726.   *
  727.   * Revision 1.5  2007/11/24 22:48:03  alfred
  728.   * - some NetBSD changes
  729. @@ -1102,7 +1102,7 @@
  730.     Erg->Typ=TempNone;
  731.     if ((strlen(Asc)<2) OR ((mytoupper(*Asc)!='R') AND (mytoupper(*Asc)!='P'))) return;
  732.  
  733. -   strcpy(h,Asc+1);
  734. +   custom_string_copy(h,Asc+1);
  735.     if ((*h=='0') AND (strlen(h)>1)) *h='$';
  736.     Erg->Contents.Int=ConstLongInt(h,&err,10);
  737.     if ((NOT err) OR (Erg->Contents.Int<0) OR (Erg->Contents.Int>255)) return;
  738. diff -uN asl-current/code47c00.c asl-newest/code47c00.c
  739. --- asl-current/code47c00.c 2005-09-08 14:31:03.000000000 -0300
  740. +++ asl-newest/code47c00.c  2013-12-18 21:08:58.231284814 -0200
  741. @@ -504,9 +504,9 @@
  742.        BEGIN
  743.         if ((strcasecmp(ArgStr[1],"A")!=0) AND (strcasecmp(ArgStr[1],"HL")!=0))
  744.          BEGIN
  745. -         strcpy(ArgStr[3],ArgStr[1]);
  746. -         strcpy(ArgStr[1],ArgStr[2]);
  747. -         strcpy(ArgStr[2],ArgStr[3]);
  748. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  749. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  750. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  751.          END
  752.         if ((strcasecmp(ArgStr[1],"A")!=0) AND (strcasecmp(ArgStr[1],"HL")!=0)) WrError(1350);
  753.         else
  754. diff -uN asl-current/code48.c asl-newest/code48.c
  755. --- asl-current/code48.c    2007-11-25 09:47:27.000000000 -0200
  756. +++ asl-newest/code48.c 2013-12-18 21:08:58.235284814 -0200
  757. @@ -711,7 +711,7 @@
  758.         OK=False;
  759.         if ((Memo("MOVD")) AND (strcasecmp(ArgStr[1],"A")==0))
  760.          BEGIN
  761. -         strcpy(ArgStr[1],ArgStr[2]); strmaxcpy(ArgStr[2],"A",255); OK=True;
  762. +         custom_string_copy(ArgStr[1],ArgStr[2]); strmaxcpy(ArgStr[2],"A",255); OK=True;
  763.          END
  764.         if (strcasecmp(ArgStr[2],"A")!=0) WrError(1350);
  765.         else if ((strlen(ArgStr[1])!=2) OR (mytoupper(*ArgStr[1])!='P')) WrError(1350);
  766. @@ -749,7 +749,7 @@
  767.         OK=False;
  768.         if (strcasecmp(ArgStr[2],"A")==0)
  769.          BEGIN
  770. -         strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); OK=True;
  771. +         custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); OK=True;
  772.          END
  773.         if (strcasecmp(ArgStr[1],"A")!=0) WrError(1350);
  774.         else
  775. @@ -888,7 +888,7 @@
  776.        BEGIN
  777.         if (strcasecmp(ArgStr[2],"A")==0)
  778.          BEGIN
  779. -         strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
  780. +         custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
  781.          END
  782.         if (strcasecmp(ArgStr[1],"A")!=0) WrError(1350);
  783.         else
  784. @@ -917,7 +917,7 @@
  785.        BEGIN
  786.         if (strcasecmp(ArgStr[2],"A")==0)
  787.          BEGIN
  788. -         strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
  789. +         custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
  790.          END
  791.         if (strcasecmp(ArgStr[1],"A")!=0) WrError(1350);
  792.         else
  793. diff -uN asl-current/code51.c asl-newest/code51.c
  794. --- asl-current/code51.c    2010-04-17 10:14:20.000000000 -0300
  795. +++ asl-newest/code51.c 2013-12-18 21:08:58.235284814 -0200
  796. @@ -21,7 +21,7 @@
  797.  /*****************************************************************************
  798.   * $Log: code51.c,v $
  799.   * Revision 1.7  2010/04/17 13:14:20  alfred
  800. - * - address overlapping strcpy()
  801. + * - address overlapping custom_string_copy()
  802.   *
  803.   * Revision 1.6  2007/11/24 22:48:04  alfred
  804.   * - some NetBSD changes
  805. @@ -1197,7 +1197,7 @@
  806.       z=0;
  807.       if ((strcasecmp(ArgStr[2],"A")==0) OR ((MomCPU>=CPU80251) AND (strcasecmp(ArgStr[2],"R11")==0)))
  808.        BEGIN
  809. -       z=0x10; strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
  810. +       z=0x10; custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255);
  811.        END
  812.       if ((strcasecmp(ArgStr[1],"A")!=0) AND ((MomCPU<CPU80251) OR (strcasecmp(ArgStr[2],"R11")==0))) WrError(1350);
  813.       else if (strcasecmp(ArgStr[2],"@DPTR")==0) PutCode(0xe0+z);
  814. diff -uN asl-current/code53c8xx.c asl-newest/code53c8xx.c
  815. --- asl-current/code53c8xx.c    2010-08-27 11:06:17.000000000 -0300
  816. +++ asl-newest/code53c8xx.c 2013-12-18 21:08:58.235284814 -0200
  817. @@ -78,13 +78,13 @@
  818.       p = QuotPos(p, ')');
  819.       if (p == Nil)
  820.        BEGIN
  821. -       strcpy(Dest, start); *Src = '\0';
  822. +       custom_string_copy(Dest, start); *Src = '\0';
  823.        END
  824.       else
  825.        BEGIN
  826.         Save = p[1]; p[1] = '\0';
  827. -       strcpy(Dest, start);
  828. -       p[1] = Save; strcpy(Src, p + 1);
  829. +       custom_string_copy(Dest, start);
  830. +       p[1] = Save; custom_string_copy(Src, p + 1);
  831.        END
  832.      END
  833.  
  834. @@ -93,7 +93,7 @@
  835.     else if (NOT IsInToken(*p))
  836.      BEGIN
  837.       *Dest = *p; Dest[1] = '\0';
  838. -     strcpy(Src, p + 1);
  839. +     custom_string_copy(Src, p + 1);
  840.      END
  841.  
  842.     /* Wort ? */
  843. @@ -103,8 +103,8 @@
  844.       for (; IsInToken(*p); p++)
  845.        if (*p == '\0') break;
  846.       Save = *p; *p = '\0';
  847. -     strcpy(Dest, start);
  848. -     *p = Save; strcpy(Src, p);
  849. +     custom_string_copy(Dest, start);
  850. +     *p = Save; custom_string_copy(Src, p);
  851.      END
  852.  END
  853.  
  854. @@ -124,11 +124,11 @@
  855.       p = RQuotPos(p, ')');
  856.       if (p == Nil)
  857.        BEGIN
  858. -       strcpy(Dest, Src); *Src = '\0';
  859. +       custom_string_copy(Dest, Src); *Src = '\0';
  860.        END
  861.       else
  862.        BEGIN
  863. -       strcpy(Dest, p); *p = '\0';
  864. +       custom_string_copy(Dest, p); *p = '\0';
  865.        END
  866.      END
  867.  
  868. @@ -145,7 +145,7 @@
  869.       for (; IsInToken(*p); p--)
  870.        if (p <= Src) break;
  871.       if (NOT IsInToken(*p)) p++;
  872. -     strcpy(Dest, p); *p = '\0';
  873. +     custom_string_copy(Dest, p); *p = '\0';
  874.      END
  875.  END
  876.  #endif
  877. @@ -305,7 +305,7 @@
  878.      BEGIN
  879.       if (Memo("INTFLY"))
  880.        BEGIN
  881. -       ArgCnt = 1; strcpy(ArgStr[1], "0");
  882. +       ArgCnt = 1; custom_string_copy(ArgStr[1], "0");
  883.        END
  884.       else if (Memo("RETURN"))
  885.        BEGIN
  886. @@ -317,7 +317,7 @@
  887.      BEGIN
  888.       if (ArgCnt == 1)
  889.        BEGIN
  890. -       if (Memo("RETURN")) strcpy(ArgStr[2], ArgStr[1]);
  891. +       if (Memo("RETURN")) custom_string_copy(ArgStr[2], ArgStr[1]);
  892.         else *ArgStr[2] = '\0';
  893.        END
  894.       Buf = 0;
  895. diff -uN asl-current/code56k.c asl-newest/code56k.c
  896. --- asl-current/code56k.c   2010-04-17 10:14:20.000000000 -0300
  897. +++ asl-newest/code56k.c    2013-12-18 21:08:58.239284814 -0200
  898. @@ -18,7 +18,7 @@
  899.  /*****************************************************************************
  900.   * $Log: code56k.c,v $
  901.   * Revision 1.6  2010/04/17 13:14:20  alfred
  902. - * - address overlapping strcpy()
  903. + * - address overlapping custom_string_copy()
  904.   *
  905.   * Revision 1.5  2008/12/14 20:22:03  alfred
  906.   * - allow forcing of long addresses
  907. @@ -228,12 +228,12 @@
  908.     p=QuotPos(str,',');
  909.     if (p==Nil)
  910.      BEGIN
  911. -     *RDest='\0'; strcpy(LDest,str);
  912. +     *RDest='\0'; custom_string_copy(LDest,str);
  913.      END
  914.     else
  915.      BEGIN
  916.       *p='\0';
  917. -      strcpy(LDest,str); strcpy(RDest,p+1);
  918. +      custom_string_copy(LDest,str); custom_string_copy(RDest,p+1);
  919.      END
  920.     free(str);
  921.  END
  922. @@ -1182,7 +1182,7 @@
  923.             else
  924.              BEGIN
  925.               SplitArg(ArgStr[1],Left,Right);
  926. -             if (strchr(Right,',')==Nil) strcpy(Mid,Right);
  927. +             if (strchr(Right,',')==Nil) custom_string_copy(Mid,Right);
  928.               else SplitArg(Right,Mid,Right);
  929.               if (NOT DecodeALUReg(Right,&Reg1,False,False,True)) SetXError(1445,Right);
  930.               else if (NOT DecodeALUReg(Mid,&Reg2,False,False,True)) SetXError(1445,Mid);
  931. diff -uN asl-current/code601.c asl-newest/code601.c
  932. --- asl-current/code601.c   2012-01-14 11:04:13.000000000 -0200
  933. +++ asl-newest/code601.c    2013-12-18 21:08:58.239284814 -0200
  934. @@ -186,7 +186,7 @@
  935.  BEGIN
  936.     String NName;
  937.  
  938. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  939. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  940.     AddSReg2(strdup(NName),NCode,NMask);
  941.     if (WithOE)
  942.      BEGIN
  943. @@ -228,7 +228,7 @@
  944.  BEGIN
  945.     String NName;
  946.  
  947. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  948. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  949.     AddSFReg2(strdup(NName),NCode,NMask);
  950.     if (WithFL)
  951.      BEGIN
  952. @@ -258,7 +258,7 @@
  953.  BEGIN
  954.     String NName;
  955.  
  956. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  957. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  958.     AddSReg2Swap(strdup(NName),NCode,NMask);
  959.     if (WithOE)
  960.      BEGIN
  961. @@ -300,7 +300,7 @@
  962.  BEGIN
  963.     String NName;
  964.  
  965. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  966. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  967.     AddSReg3(strdup(NName),NCode,NMask);
  968.     if (WithOE)
  969.      BEGIN
  970. @@ -342,7 +342,7 @@
  971.  BEGIN
  972.     String NName;
  973.  
  974. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  975. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  976.     AddSFReg3(strdup(NName),NCode,NMask);
  977.     if (WithFL)
  978.      BEGIN
  979. @@ -364,7 +364,7 @@
  980.  BEGIN
  981.     String NName;
  982.  
  983. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  984. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  985.     AddSReg3Swap(strdup(NName),NCode,NMask);
  986.     if (WithFL)
  987.      BEGIN
  988. @@ -394,7 +394,7 @@
  989.  BEGIN
  990.     String NName;
  991.  
  992. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  993. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  994.     AddSFReg4(strdup(NName),NCode,NMask);
  995.     if (WithFL)
  996.      BEGIN
  997. @@ -432,7 +432,7 @@
  998.  BEGIN
  999.     String NName;
  1000.  
  1001. -   strcpy(NName,(MomCPU==CPU6000)?NName2:NName1);
  1002. +   custom_string_copy(NName,(MomCPU==CPU6000)?NName2:NName1);
  1003.     AddSReg2Imm(strdup(NName),NCode,NMask);
  1004.     if (WithFL)
  1005.      BEGIN
  1006. @@ -1131,7 +1131,7 @@
  1007.       BEGIN
  1008.        if (ArgCnt==1)
  1009.         BEGIN
  1010. -        ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
  1011. +        ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
  1012.         END
  1013.        if (ArgCnt!=2) WrError(1110);
  1014.        else if (NOT ChkCPU(Reg2Orders[z].CPUMask)) WrXError(1500,OpPart);
  1015. @@ -1169,7 +1169,7 @@
  1016.       BEGIN
  1017.        if (ArgCnt==1)
  1018.         BEGIN
  1019. -        ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
  1020. +        ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
  1021.         END
  1022.        if (ArgCnt!=2) WrError(1110);
  1023.        else if (NOT ChkCPU(FReg2Orders[z].CPUMask)) WrXError(1500,OpPart);
  1024. @@ -1189,7 +1189,7 @@
  1025.       BEGIN
  1026.        if (ArgCnt==1)
  1027.         BEGIN
  1028. -        ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
  1029. +        ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
  1030.         END
  1031.        if (ArgCnt!=2) WrError(1110);
  1032.        else if (NOT ChkCPU(Reg2BOrders[z].CPUMask)) WrXError(1500,OpPart);
  1033. @@ -1210,7 +1210,7 @@
  1034.       BEGIN
  1035.        if (ArgCnt==1)
  1036.         BEGIN
  1037. -        ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]);
  1038. +        ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]);
  1039.         END
  1040.        if (ArgCnt!=2) WrError(1110);
  1041.        else if (NOT ChkCPU(Reg2SwapOrders[z].CPUMask)) WrXError(1500,OpPart);
  1042. @@ -1246,7 +1246,7 @@
  1043.       BEGIN
  1044.        if (ArgCnt==2)
  1045.         BEGIN
  1046. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1047. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1048.         END
  1049.        if (ArgCnt!=3) WrError(1110);
  1050.        else if (NOT ChkCPU(Reg3Orders[z].CPUMask)) WrXError(1500,OpPart);
  1051. @@ -1267,7 +1267,7 @@
  1052.       BEGIN
  1053.        if (ArgCnt==2)
  1054.         BEGIN
  1055. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1056. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1057.         END
  1058.        if (ArgCnt!=3) WrError(1110);
  1059.        else if (NOT ChkCPU(CReg3Orders[z].CPUMask)) WrXError(1500,OpPart);
  1060. @@ -1288,7 +1288,7 @@
  1061.       BEGIN
  1062.        if (ArgCnt==2)
  1063.         BEGIN
  1064. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1065. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1066.         END
  1067.        if (ArgCnt!=3) WrError(1110);
  1068.        else if (NOT ChkCPU(FReg3Orders[z].CPUMask)) WrXError(1500,OpPart);
  1069. @@ -1309,7 +1309,7 @@
  1070.       BEGIN
  1071.        if (ArgCnt==2)
  1072.         BEGIN
  1073. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1074. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1075.         END
  1076.        if (ArgCnt!=3) WrError(1110);
  1077.        else if (NOT ChkCPU(Reg3SwapOrders[z].CPUMask)) WrXError(1500,OpPart);
  1078. @@ -1347,8 +1347,8 @@
  1079.       BEGIN
  1080.        if (ArgCnt==3)
  1081.         BEGIN
  1082. -        ArgCnt=4; strcpy(ArgStr[4],ArgStr[3]);
  1083. -        strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1084. +        ArgCnt=4; custom_string_copy(ArgStr[4],ArgStr[3]);
  1085. +        custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1086.         END
  1087.        if (ArgCnt!=4) WrError(1110);
  1088.        else if (NOT ChkCPU(FReg4Orders[z].CPUMask)) WrXError(1500,OpPart);
  1089. @@ -1422,7 +1422,7 @@
  1090.       BEGIN
  1091.        if (ArgCnt==2)
  1092.         BEGIN
  1093. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1094. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1095.         END
  1096.        if (ArgCnt!=3) WrError(1110);
  1097.        else if (NOT ChkCPU(Imm16Orders[z].CPUMask)) WrXError(1500,OpPart);
  1098. @@ -1446,7 +1446,7 @@
  1099.       BEGIN
  1100.        if (ArgCnt==2)
  1101.         BEGIN
  1102. -        ArgCnt=3; strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  1103. +        ArgCnt=3; custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  1104.         END
  1105.        if (ArgCnt!=3) WrError(1110);
  1106.        else if (NOT ChkCPU(Imm16SwapOrders[z].CPUMask)) WrXError(1500,OpPart);
  1107. @@ -1472,7 +1472,7 @@
  1108.      BEGIN
  1109.       if (ArgCnt==2)
  1110.        BEGIN
  1111. -       strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]); ArgCnt=3;
  1112. +       custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]); ArgCnt=3;
  1113.        END
  1114.       if (ArgCnt!=3) WrError(1110);
  1115.       else if (NOT DecodeFPReg(ArgStr[1],&Dest)) WrError(1350);
  1116. @@ -1516,16 +1516,16 @@
  1117.       if (ArgCnt==1)
  1118.       BEGIN
  1119.        ArgCnt=2;
  1120. -      if      ((Memo("MFTB")) OR (Memo("MFTBL"))) strcpy(ArgStr[2], "268");
  1121. -      else if (Memo("MFTBU")) strcpy(ArgStr[2], "269");
  1122. -      else if ((Memo("MTTB")) OR (Memo("MTTBL"))) strcpy(ArgStr[2], "284");
  1123. -      else if (Memo("MTTBU")) strcpy(ArgStr[2], "285");
  1124. +      if      ((Memo("MFTB")) OR (Memo("MFTBL"))) custom_string_copy(ArgStr[2], "268");
  1125. +      else if (Memo("MFTBU")) custom_string_copy(ArgStr[2], "269");
  1126. +      else if ((Memo("MTTB")) OR (Memo("MTTBL"))) custom_string_copy(ArgStr[2], "284");
  1127. +      else if (Memo("MTTBU")) custom_string_copy(ArgStr[2], "285");
  1128.        /* already swapped */
  1129.       END
  1130.       else
  1131.        if      ((ArgCnt == 2) AND ((Memo("MTTB")) OR (Memo("MTTBL")) OR (Memo("MTTBU"))))
  1132.        BEGIN
  1133. -        strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  1134. +        custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  1135.        END
  1136.       if (ArgCnt!=2) WrError(1110);
  1137.       else if (NOT DecodeGenReg(ArgStr[1],&Dest)) WrError(1350);
  1138. @@ -1553,7 +1553,7 @@
  1139.      BEGIN
  1140.       if (Memo("MTSPR"))
  1141.        BEGIN
  1142. -       strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  1143. +       custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  1144.        END
  1145.       if (ArgCnt!=2) WrError(1110);
  1146.       else if (NOT DecodeGenReg(ArgStr[1],&Dest)) WrError(1350);
  1147. @@ -1575,7 +1575,7 @@
  1148.      BEGIN
  1149.       if (Memo("MTDCR"))
  1150.        BEGIN
  1151. -       strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  1152. +       custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  1153.        END
  1154.       if (ArgCnt!=2) WrError(1110);
  1155.       else if (MomCPU>=CPU505) WrXError(1500,OpPart);
  1156. @@ -1598,7 +1598,7 @@
  1157.      BEGIN
  1158.       if (Memo("MTSR"))
  1159.        BEGIN
  1160. -       strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  1161. +       custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  1162.        END
  1163.       if (ArgCnt!=2) WrError(1110);
  1164.       else if (NOT DecodeGenReg(ArgStr[1],&Dest)) WrError(1350);
  1165. @@ -1830,7 +1830,7 @@
  1166.      BEGIN
  1167.       if (ArgCnt==3)
  1168.        BEGIN
  1169. -       strcpy(ArgStr[4],ArgStr[3]); strcpy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
  1170. +       custom_string_copy(ArgStr[4],ArgStr[3]); custom_string_copy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
  1171.        END
  1172.       if (ArgCnt!=4) WrError(1110);
  1173.       else if (NOT DecodeGenReg(ArgStr[4],&Src2)) WrError(1350);
  1174. @@ -1871,7 +1871,7 @@
  1175.      BEGIN
  1176.       if (ArgCnt==3)
  1177.        BEGIN
  1178. -       strcpy(ArgStr[4],ArgStr[3]); strcpy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
  1179. +       custom_string_copy(ArgStr[4],ArgStr[3]); custom_string_copy(ArgStr[3],ArgStr[2]); strmaxcpy(ArgStr[2],"0",255); ArgCnt=4;
  1180.        END
  1181.       if (ArgCnt!=4) WrError(1110);
  1182.       else
  1183. diff -uN asl-current/code65.c asl-newest/code65.c
  1184. --- asl-current/code65.c    2010-08-27 11:52:41.000000000 -0300
  1185. +++ asl-newest/code65.c 2013-12-18 21:08:58.239284814 -0200
  1186. @@ -15,7 +15,7 @@
  1187.  /*****************************************************************************
  1188.   * $Log: code65.c,v $
  1189.   * Revision 1.4  2010/08/27 14:52:41  alfred
  1190. - * - some more overlapping strcpy() cleanups
  1191. + * - some more overlapping custom_string_copy() cleanups
  1192.   *
  1193.   * Revision 1.3  2005/09/08 17:31:03  alfred
  1194.   * - add missing include
  1195. @@ -556,7 +556,7 @@
  1196.  
  1197.         if (IsIndirect(ArgStr[1]))
  1198.          BEGIN
  1199. -         strcpy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
  1200. +         custom_string_copy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
  1201.           ChkZero(s1,&ZeroMode);
  1202.           if (ZeroMode==2)
  1203.            BEGIN
  1204. @@ -611,7 +611,7 @@
  1205.  
  1206.       if ((IsIndirect(ArgStr[1])) AND (strcasecmp(ArgStr[2],"Y")==0))
  1207.        BEGIN
  1208. -       strcpy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
  1209. +       custom_string_copy(s1,ArgStr[1]+1); s1[strlen(s1)-1]='\0';
  1210.         ChkZero(s1,&ZeroMode);
  1211.         AdrVals[0]=EvalIntExpression(s1,UInt8,&ValOK);
  1212.         if (ValOK)
  1213. @@ -624,7 +624,7 @@
  1214.  
  1215.       else
  1216.        BEGIN
  1217. -       strcpy(s1,ArgStr[1]);
  1218. +       custom_string_copy(s1,ArgStr[1]);
  1219.         ChkZero(s1,&ZeroMode);
  1220.         if (ZeroMode==2)
  1221.          BEGIN
  1222. diff -uN asl-current/code6805.c asl-newest/code6805.c
  1223. --- asl-current/code6805.c  2013-03-31 15:06:47.000000000 -0300
  1224. +++ asl-newest/code6805.c   2013-12-18 21:08:58.239284814 -0200
  1225. @@ -132,15 +132,15 @@
  1226.  {
  1227.    if (*s=='<')
  1228.    {
  1229. -    strcpy(serg, s + 1); *pErg = 2;
  1230. +    custom_string_copy(serg, s + 1); *pErg = 2;
  1231.    }
  1232.    else if (*s == '>')
  1233.    {
  1234. -    strcpy(serg, s + 1); *pErg = 1;
  1235. +    custom_string_copy(serg, s + 1); *pErg = 1;
  1236.    }
  1237.    else
  1238.    {
  1239. -    strcpy(serg, s); *pErg = 0;
  1240. +    custom_string_copy(serg, s); *pErg = 0;
  1241.    }
  1242.  }
  1243.  
  1244. @@ -964,7 +964,7 @@
  1245.    {
  1246.      int z;
  1247.  
  1248. -    for (z = ArgCnt; z >= 1; z--) strcpy(ArgStr[z + 1], ArgStr[z]);
  1249. +    for (z = ArgCnt; z >= 1; z--) custom_string_copy(ArgStr[z + 1], ArgStr[z]);
  1250.      *ArgStr[1] = ch; ArgStr[1][1] = '\0'; ArgCnt++;
  1251.      OpPart[l - 1] = '\0';
  1252.    }
  1253. diff -uN asl-current/code6809.c asl-newest/code6809.c
  1254. --- asl-current/code6809.c  2013-03-31 17:06:19.000000000 -0300
  1255. +++ asl-newest/code6809.c   2013-12-18 21:08:58.239284814 -0200
  1256. @@ -20,7 +20,7 @@
  1257.   * - allows Moto16 pseudo-ops for 6809
  1258.   *
  1259.   * Revision 1.5  2010/04/17 13:14:20  alfred
  1260. - * - address overlapping strcpy()
  1261. + * - address overlapping custom_string_copy()
  1262.   *
  1263.   * Revision 1.4  2007/11/24 22:48:04  alfred
  1264.   * - some NetBSD changes
  1265. @@ -1133,7 +1133,7 @@
  1266.          BAsmCode[1]=EvalIntExpression(ArgStr[1]+1,Int8,&OK);
  1267.          if (OK)
  1268.           BEGIN
  1269. -          for (z2=1; z2<ArgCnt; z2++) strcpy(ArgStr[z2],ArgStr[z2+1]);
  1270. +          for (z2=1; z2<ArgCnt; z2++) custom_string_copy(ArgStr[z2],ArgStr[z2+1]);
  1271.            ArgCnt--; DecodeAdr();
  1272.            if (AdrMode==ModImm) WrError(1350);
  1273.            else
  1274. @@ -1165,7 +1165,7 @@
  1275.            else if ((BAsmCode[2]<8) OR (BAsmCode[2]>11)) WrError(1980);
  1276.            else
  1277.             BEGIN
  1278. -            strcpy(ArgStr[1],ArgStr[2]); ArgCnt=1; DecodeAdr();
  1279. +            custom_string_copy(ArgStr[1],ArgStr[2]); ArgCnt=1; DecodeAdr();
  1280.              if (AdrMode!=ModDir) WrError(1350);
  1281.              else
  1282.               BEGIN
  1283. diff -uN asl-current/code6812.c asl-newest/code6812.c
  1284. --- asl-current/code6812.c  2010-08-27 11:52:41.000000000 -0300
  1285. +++ asl-newest/code6812.c   2013-12-18 21:08:58.243284814 -0200
  1286. @@ -14,10 +14,10 @@
  1287.  /*****************************************************************************
  1288.   * $Log: code6812.c,v $
  1289.   * Revision 1.18  2010/08/27 14:52:41  alfred
  1290. - * - some more overlapping strcpy() cleanups
  1291. + * - some more overlapping custom_string_copy() cleanups
  1292.   *
  1293.   * Revision 1.17  2010/04/17 13:14:20  alfred
  1294. - * - address overlapping strcpy()
  1295. + * - address overlapping custom_string_copy()
  1296.   *
  1297.   * Revision 1.16  2007/11/24 22:48:04  alfred
  1298.   * - some NetBSD changes
  1299. @@ -237,10 +237,10 @@
  1300.    int l = strlen(Asc_o);
  1301.  
  1302.    if ((*Asc_o == '-') || (*Asc_o == '+'))
  1303. -    strcpy(Asc, Asc_o + 1);
  1304. +    custom_string_copy(Asc, Asc_o + 1);
  1305.    else
  1306.    {
  1307. -    strcpy(Asc, Asc_o);
  1308. +    custom_string_copy(Asc, Asc_o);
  1309.      if ((Asc_o[l - 1] == '-') || (Asc_o[l - 1] == '+'))
  1310.        Asc[l - 1] = '\0';
  1311.    }
  1312. @@ -610,9 +610,9 @@
  1313.    if (p >= ArgStr[Src])
  1314.    {
  1315.      for (z = ArgCnt; z >= Src; z--)
  1316. -      strcpy(ArgStr[z + 1], ArgStr[z]);
  1317. +      custom_string_copy(ArgStr[z + 1], ArgStr[z]);
  1318.      ArgCnt++;
  1319. -    *p = '\0'; strcpy(ArgStr[Src + 1], p + 1);
  1320. +    *p = '\0'; custom_string_copy(ArgStr[Src + 1], p + 1);
  1321.      KillPostBlanks(ArgStr[Src]); KillPrefBlanks(ArgStr[Src + 1]);
  1322.    }
  1323.  }
  1324. diff -uN asl-current/code68.c asl-newest/code68.c
  1325. --- asl-current/code68.c    2010-04-17 10:14:20.000000000 -0300
  1326. +++ asl-newest/code68.c 2013-12-18 21:08:58.243284814 -0200
  1327. @@ -17,7 +17,7 @@
  1328.  /*****************************************************************************
  1329.   * $Log: code68.c,v $
  1330.   * Revision 1.9  2010/04/17 13:14:20  alfred
  1331. - * - address overlapping strcpy()
  1332. + * - address overlapping custom_string_copy()
  1333.   *
  1334.   * Revision 1.8  2009/04/13 07:53:46  alfred
  1335.   * - silence Borlanc C++ warning
  1336. @@ -389,8 +389,8 @@
  1337.     while ((p>ArgStr[Src]) AND (NOT isspace((unsigned int) *p))) p--;
  1338.     if (p>ArgStr[Src])
  1339.      BEGIN
  1340. -     for (z=ArgCnt; z>=Src; z--) strcpy(ArgStr[z+1],ArgStr[z]); ArgCnt++;
  1341. -     strcpy(ArgStr[Src+1],p+1); *p='\0';
  1342. +     for (z=ArgCnt; z>=Src; z--) custom_string_copy(ArgStr[z+1],ArgStr[z]); ArgCnt++;
  1343. +     custom_string_copy(ArgStr[Src+1],p+1); *p='\0';
  1344.       KillPostBlanks(ArgStr[Src]); KillPrefBlanks(ArgStr[Src+1]);
  1345.      END
  1346.  END
  1347. @@ -582,9 +582,9 @@
  1348.  
  1349.     if (MomCPU==CPU6301)
  1350.     {
  1351. -     strcpy(ArgStr[ArgCnt + 1], ArgStr[1]);
  1352. -     for (z = 1; z <= ArgCnt - 1; z++) strcpy(ArgStr[z], ArgStr[z + 1]);
  1353. -     strcpy(ArgStr[ArgCnt], ArgStr[ArgCnt + 1]);
  1354. +     custom_string_copy(ArgStr[ArgCnt + 1], ArgStr[1]);
  1355. +     for (z = 1; z <= ArgCnt - 1; z++) custom_string_copy(ArgStr[z], ArgStr[z + 1]);
  1356. +     custom_string_copy(ArgStr[ArgCnt], ArgStr[ArgCnt + 1]);
  1357.     }
  1358.     if ((ArgCnt >= 1) && (ArgCnt <= 2)) Try2Split(ArgCnt);
  1359.     if ((ArgCnt < 2) || (ArgCnt > 3)) WrError(1110);
  1360. @@ -840,7 +840,7 @@
  1361.         (strncmp(OpPart,Op,OpLen)==0) AND
  1362.         ((Ch=='A') OR (Ch=='B')))
  1363.      BEGIN
  1364. -     for (z=ArgCnt; z>=1; z--) strcpy(ArgStr[z+1],ArgStr[z]);
  1365. +     for (z=ArgCnt; z>=1; z--) custom_string_copy(ArgStr[z+1],ArgStr[z]);
  1366.       ArgStr[1][0]=Ch; ArgStr[1][1]='\0';
  1367.       OpPart[OpPartLen-1]='\0'; ArgCnt++;
  1368.      END
  1369. diff -uN asl-current/code68k.c asl-newest/code68k.c
  1370. --- asl-current/code68k.c   2012-07-19 17:30:19.000000000 -0300
  1371. +++ asl-newest/code68k.c    2013-12-18 21:08:58.243284814 -0200
  1372. @@ -43,13 +43,13 @@
  1373.   * - -
  1374.   *
  1375.   * Revision 1.15  2010/08/27 14:52:41  alfred
  1376. - * - some more overlapping strcpy() cleanups
  1377. + * - some more overlapping custom_string_copy() cleanups
  1378.   *
  1379.   * Revision 1.14  2010/06/13 17:48:57  alfred
  1380.   * - do not optimize BSR with zero displacement
  1381.   *
  1382.   * Revision 1.13  2010/04/17 13:14:21  alfred
  1383. - * - address overlapping strcpy()
  1384. + * - address overlapping custom_string_copy()
  1385.   *
  1386.   * Revision 1.12  2010/03/07 10:45:22  alfred
  1387.   * - generalization of Motorola disposal instructions
  1388. @@ -385,7 +385,7 @@
  1389.  
  1390.     p = strchr(Arg, '{');
  1391.     if (p == Nil) return False;
  1392. -   *p = '\0'; strcpy(Desc, p + 1);
  1393. +   *p = '\0'; custom_string_copy(Desc, p + 1);
  1394.     if ((!*Desc) || (Desc[strlen(Desc) - 1] != '}')) return False;
  1395.     Desc[strlen(Desc) - 1] = '\0';
  1396.  
  1397. @@ -700,7 +700,7 @@
  1398.  
  1399.     if ((l==5) AND (*Asc=='-') AND (Asc[1]=='(') AND (Asc[4]==')'))
  1400.      BEGIN
  1401. -     strcpy(CReg,Asc+2); CReg[2]='\0';
  1402. +     custom_string_copy(CReg,Asc+2); CReg[2]='\0';
  1403.       if (CodeReg(CReg,&rerg))
  1404.        if (rerg>7)
  1405.         BEGIN
  1406. @@ -712,7 +712,7 @@
  1407.  
  1408.     if ((l==5) AND (*Asc=='(') AND (Asc[3]==')') AND (Asc[4]=='+'))
  1409.      BEGIN
  1410. -     strcpy(CReg,Asc+1); CReg[2]='\0';
  1411. +     custom_string_copy(CReg,Asc+1); CReg[2]='\0';
  1412.       if (CodeReg(CReg,&rerg))
  1413.        if (rerg>7)
  1414.         BEGIN
  1415. @@ -765,11 +765,11 @@
  1416.         while (((NOT doklamm) OR (*p != ',')) AND (*p != '\0'));
  1417.         if (*p == '\0')
  1418.          BEGIN
  1419. -         strcpy(AdrComps[CompCnt].Name, Asc); *Asc = '\0';
  1420. +         custom_string_copy(AdrComps[CompCnt].Name, Asc); *Asc = '\0';
  1421.          END
  1422.         else
  1423.          BEGIN
  1424. -         *p = '\0'; strcpy(AdrComps[CompCnt].Name, Asc); strmov(Asc, p + 1);
  1425. +         *p = '\0'; custom_string_copy(AdrComps[CompCnt].Name, Asc); strmov(Asc, p + 1);
  1426.          END
  1427.         if (NOT ClassComp(AdrComps + CompCnt))
  1428.          BEGIN
  1429. @@ -793,7 +793,7 @@
  1430.  
  1431.         else if (AdrComps[CompCnt].Art == Disp)
  1432.          BEGIN
  1433. -         strcpy(OutDisp, AdrComps[CompCnt].Name);
  1434. +         custom_string_copy(OutDisp, AdrComps[CompCnt].Name);
  1435.  
  1436.           if (NOT SplitSize(OutDisp, &OutDispLen))
  1437.            return;
  1438. @@ -1066,7 +1066,7 @@
  1439.  
  1440.         /* indirektes Argument herauskopieren: */
  1441.  
  1442. -       strcpy(Asc,AdrComps[0].Name+1);
  1443. +       custom_string_copy(Asc,AdrComps[0].Name+1);
  1444.         Asc[strlen(Asc)-1]='\0';
  1445.  
  1446.         /* Felder loeschen: */
  1447. @@ -1083,11 +1083,11 @@
  1448.           p=strchr(Asc,',');
  1449.           if (p==Nil)
  1450.            BEGIN
  1451. -           strcpy(OneComp.Name,Asc); *Asc='\0';
  1452. +           custom_string_copy(OneComp.Name,Asc); *Asc='\0';
  1453.            END
  1454.           else
  1455.            BEGIN
  1456. -           *p='\0'; strcpy(OneComp.Name,Asc); strmov(Asc,p+1);
  1457. +           *p='\0'; custom_string_copy(OneComp.Name,Asc); strmov(Asc,p+1);
  1458.            END
  1459.           if (NOT ClassComp(&OneComp))
  1460.            BEGIN
  1461. @@ -1285,11 +1285,11 @@
  1462.      p = strchr(Asc, '/');
  1463.      if (!p)
  1464.      {
  1465. -      strcpy(s, Asc); *Asc = '\0';
  1466. +      custom_string_copy(s, Asc); *Asc = '\0';
  1467.      }
  1468.      else
  1469.      {
  1470. -      *p='\0'; strcpy(s, Asc); strmov(Asc, p+1);
  1471. +      *p='\0'; custom_string_copy(s, Asc); strmov(Asc, p+1);
  1472.      }
  1473.      if (*Asc == '/')
  1474.        strmov(Asc, Asc + 1);
  1475. @@ -1476,7 +1476,7 @@
  1476.  
  1477.    if (ArgCnt == 1)
  1478.    {
  1479. -    strcpy(ArgStr[2],ArgStr[1]); strcpy(ArgStr[1], "#1");
  1480. +    custom_string_copy(ArgStr[2],ArgStr[1]); custom_string_copy(ArgStr[1], "#1");
  1481.      ArgCnt = 2;
  1482.    }
  1483.    if (ArgCnt != 2) WrError(1110);
  1484. @@ -2764,7 +2764,7 @@
  1485.        }
  1486.        else
  1487.        {
  1488. -        strcpy(ArgStr[3], p + 1); *p = '\0';
  1489. +        custom_string_copy(ArgStr[3], p + 1); *p = '\0';
  1490.          DecodeAdr(ArgStr[1], Mdata);
  1491.          if (AdrNum != 0)
  1492.          {
  1493. @@ -2935,7 +2935,7 @@
  1494.  
  1495.     if ((ArgCnt==1) AND (NOT Op->Dya))
  1496.      BEGIN
  1497. -     strcpy(ArgStr[2],ArgStr[1]); ArgCnt=2;
  1498. +     custom_string_copy(ArgStr[2],ArgStr[1]); ArgCnt=2;
  1499.      END
  1500.     if (*AttrPart=='\0') OpSize=6;
  1501.     if (OpSize==3) WrError(1130);
  1502. @@ -3327,11 +3327,11 @@
  1503.       h1=strchr(Asc,'/');
  1504.       if (h1==Nil)
  1505.        BEGIN
  1506. -       strcpy(s,Asc); *Asc='\0';
  1507. +       custom_string_copy(s,Asc); *Asc='\0';
  1508.        END
  1509.       else
  1510.        BEGIN
  1511. -       *h1='\0'; strcpy(s,Asc); strmov(Asc, h1 + 1);
  1512. +       *h1='\0'; custom_string_copy(s,Asc); strmov(Asc, h1 + 1);
  1513.        END
  1514.       if (strcasecmp(s,"FPCR")==0) hw|=0x400;
  1515.       else if (strcasecmp(s,"FPSR")==0) hw|=0x200;
  1516. @@ -3458,7 +3458,7 @@
  1517.         p=strchr(AttrPart,'{');
  1518.         if (p!=0)                               /* k-Faktor abspalten */
  1519.          BEGIN
  1520. -         strcpy(sk,p); *p='\0';
  1521. +         custom_string_copy(sk,p); *p='\0';
  1522.          END
  1523.         else *sk='\0';
  1524.         DecodeAdr(ArgStr[2],Mdata+Madr+Madri+Mpost+Mpre+Mdadri+Maix+Mabs+Mfpn+Mfpcr);
  1525. @@ -3602,7 +3602,7 @@
  1526.         p=strrchr(ArgStr[2],':');
  1527.         if (p!=Nil)
  1528.          BEGIN
  1529. -         *p='\0'; strcpy(sk,ArgStr[2]); strmov(ArgStr[2],p+1);
  1530. +         *p='\0'; custom_string_copy(sk,ArgStr[2]); strmov(ArgStr[2],p+1);
  1531.          END
  1532.         else *sk='\0';
  1533.         DecodeAdr(sk,Mfpn);
  1534. @@ -4440,7 +4440,7 @@
  1535.        BEGIN
  1536.         if (strchr(ArgStr[2],':')==Nil)
  1537.          BEGIN
  1538. -         strcpy(ArgStr[3], ArgStr[2]);
  1539. +         custom_string_copy(ArgStr[3], ArgStr[2]);
  1540.           strcat(ArgStr[2], ":");
  1541.           strcat(ArgStr[2], ArgStr[3]);
  1542.          END
  1543. diff -uN asl-current/code68rs08.c asl-newest/code68rs08.c
  1544. --- asl-current/code68rs08.c    2013-03-31 15:06:47.000000000 -0300
  1545. +++ asl-newest/code68rs08.c 2013-12-18 21:08:58.243284814 -0200
  1546. @@ -106,15 +106,15 @@
  1547.  {
  1548.    if (*s=='<') /* short / tiny */
  1549.    {
  1550. -    strcpy(serg, s + 1); *pErg = 2;
  1551. +    custom_string_copy(serg, s + 1); *pErg = 2;
  1552.    }
  1553.    else if (*s == '>') /* direct */
  1554.    {
  1555. -    strcpy(serg, s + 1); *pErg = 1;
  1556. +    custom_string_copy(serg, s + 1); *pErg = 1;
  1557.    }
  1558.    else /* let the assembler make the choice */
  1559.    {
  1560. -    strcpy(serg, s); *pErg = 0;
  1561. +    custom_string_copy(serg, s); *pErg = 0;
  1562.    }
  1563.  }
  1564.  
  1565. @@ -824,7 +824,7 @@
  1566.    {
  1567.      int z;
  1568.  
  1569. -    for (z = ArgCnt; z >= 1; z--) strcpy(ArgStr[z + 1], ArgStr[z]);
  1570. +    for (z = ArgCnt; z >= 1; z--) custom_string_copy(ArgStr[z + 1], ArgStr[z]);
  1571.      *ArgStr[1] = ch; ArgStr[1][1] = '\0'; ArgCnt++;
  1572.      OpPart[l - 1] = '\0';
  1573.    }
  1574. diff -uN asl-current/code7000.c asl-newest/code7000.c
  1575. --- asl-current/code7000.c  2010-04-17 10:14:22.000000000 -0300
  1576. +++ asl-newest/code7000.c   2013-12-18 21:08:58.247284814 -0200
  1577. @@ -14,7 +14,7 @@
  1578.  /*****************************************************************************
  1579.   * $Log: code7000.c,v $
  1580.   * Revision 1.7  2010/04/17 13:14:22  alfred
  1581. - * - address overlapping strcpy()
  1582. + * - address overlapping custom_string_copy()
  1583.   *
  1584.   * Revision 1.6  2007/11/24 22:48:05  alfred
  1585.   * - some NetBSD changes
  1586. @@ -616,7 +616,7 @@
  1587.           NIs32=(DOpSize==2);
  1588.           if (NOT NIs32) DispAcc&=0xffff;
  1589.           /* Literale sektionsspezifisch */
  1590. -         strcpy(AdrStr,"[PARENT0]");
  1591. +         custom_string_copy(AdrStr,"[PARENT0]");
  1592.           /* schon vorhanden ? */
  1593.           Lauf=FirstLiteral; p=0; OK=False; Last=Nil; Found=False;
  1594.           while ((Lauf!=Nil) AND (NOT Found))
  1595. @@ -836,16 +836,16 @@
  1596.      pos = FirstBlank(ArgStr[1]);
  1597.      if (!pos)
  1598.      {
  1599. -      strcpy(OpPart, ArgStr[1]);
  1600. +      custom_string_copy(OpPart, ArgStr[1]);
  1601.        for (z = 1; z < ArgCnt; z++)
  1602. -        strcpy(ArgStr[z], ArgStr[z + 1]);
  1603. +        custom_string_copy(ArgStr[z], ArgStr[z + 1]);
  1604.        ArgCnt--;
  1605.      }
  1606.      else
  1607.      {
  1608.        *pos = '\0';
  1609. -      strcpy(OpPart, ArgStr[1]);
  1610. -      strcpy(ArgStr[1], pos + 1);
  1611. +      custom_string_copy(OpPart, ArgStr[1]);
  1612. +      custom_string_copy(ArgStr[1], pos + 1);
  1613.      }
  1614.    }
  1615.  
  1616. @@ -1029,9 +1029,9 @@
  1617.        BEGIN
  1618.         if (Memo("LDC"))
  1619.          BEGIN
  1620. -         strcpy(ArgStr[3],ArgStr[1]);
  1621. -         strcpy(ArgStr[1],ArgStr[2]);
  1622. -         strcpy(ArgStr[2],ArgStr[3]);
  1623. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  1624. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  1625. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  1626.          END
  1627.         if (DecodeCtrlReg(ArgStr[1],&HReg))
  1628.          BEGIN
  1629. @@ -1063,9 +1063,9 @@
  1630.        BEGIN
  1631.         if (Memo("LDS"))
  1632.          BEGIN
  1633. -         strcpy(ArgStr[3],ArgStr[1]);
  1634. -         strcpy(ArgStr[1],ArgStr[2]);
  1635. -         strcpy(ArgStr[2],ArgStr[3]);
  1636. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  1637. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  1638. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  1639.          END
  1640.         if (!DecodeSReg(ArgStr[1], &HReg)) WrError(1440);
  1641.         else
  1642. diff -uN asl-current/code75k0.c asl-newest/code75k0.c
  1643. --- asl-current/code75k0.c  2010-04-17 10:14:22.000000000 -0300
  1644. +++ asl-newest/code75k0.c   2013-12-18 21:08:58.247284814 -0200
  1645. @@ -13,7 +13,7 @@
  1646.  /*****************************************************************************
  1647.   * $Log: code75k0.c,v $
  1648.   * Revision 1.5  2010/04/17 13:14:22  alfred
  1649. - * - address overlapping strcpy()
  1650. + * - address overlapping custom_string_copy()
  1651.   *
  1652.   * Revision 1.4  2005/10/02 10:00:45  alfred
  1653.   * - ConstLongInt gets default base, correct length check on KCPSM3 registers
  1654. @@ -775,9 +775,9 @@
  1655.         z=Ord(Memo("IN"));
  1656.         if (z>0)
  1657.          BEGIN
  1658. -         strcpy(ArgStr[3],ArgStr[2]);
  1659. -         strcpy(ArgStr[2],ArgStr[1]);
  1660. -         strcpy(ArgStr[1],ArgStr[3]);
  1661. +         custom_string_copy(ArgStr[3],ArgStr[2]);
  1662. +         custom_string_copy(ArgStr[2],ArgStr[1]);
  1663. +         custom_string_copy(ArgStr[1],ArgStr[3]);
  1664.          END
  1665.         if (strncasecmp(ArgStr[1],"PORT",4)!=0) WrError(1350);
  1666.         else
  1667. diff -uN asl-current/code7700.c asl-newest/code7700.c
  1668. --- asl-current/code7700.c  2010-08-27 11:52:42.000000000 -0300
  1669. +++ asl-newest/code7700.c   2013-12-18 21:08:58.247284814 -0200
  1670. @@ -13,10 +13,10 @@
  1671.  /*****************************************************************************
  1672.   * $Log: code7700.c,v $
  1673.   * Revision 1.6  2010/08/27 14:52:42  alfred
  1674. - * - some more overlapping strcpy() cleanups
  1675. + * - some more overlapping custom_string_copy() cleanups
  1676.   *
  1677.   * Revision 1.5  2010/04/17 13:14:22  alfred
  1678. - * - address overlapping strcpy()
  1679. + * - address overlapping custom_string_copy()
  1680.   *
  1681.   * Revision 1.4  2005/09/08 17:31:04  alfred
  1682.   * - add missing include
  1683. diff -uN asl-current/code7720.c asl-newest/code7720.c
  1684. --- asl-current/code7720.c  2010-04-17 10:14:22.000000000 -0300
  1685. +++ asl-newest/code7720.c   2013-12-18 21:08:58.247284814 -0200
  1686. @@ -19,7 +19,7 @@
  1687.  /*****************************************************************************
  1688.   * $Log: code7720.c,v $
  1689.   * Revision 1.6  2010/04/17 13:14:22  alfred
  1690. - * - address overlapping strcpy()
  1691. + * - address overlapping custom_string_copy()
  1692.   *
  1693.   * Revision 1.5  2008/11/23 10:39:17  alfred
  1694.   * - allow strings with NUL characters
  1695. @@ -361,7 +361,7 @@
  1696.      {
  1697.        strmaxcpy(OpPart, ArgStr[1], 255);
  1698.        for (z = 1; z < ArgCnt; z++)
  1699. -       strcpy(ArgStr[z], ArgStr[z + 1]);
  1700. +       custom_string_copy(ArgStr[z], ArgStr[z + 1]);
  1701.        ArgCnt--;
  1702.      }
  1703.      if (!LookupInstTable(OpTable,OpPart)) WrXError(1200,OpPart);
  1704. diff -uN asl-current/code77230.c asl-newest/code77230.c
  1705. --- asl-current/code77230.c 2010-04-17 10:14:22.000000000 -0300
  1706. +++ asl-newest/code77230.c  2013-12-18 21:08:58.247284814 -0200
  1707. @@ -20,7 +20,7 @@
  1708.  /*****************************************************************************
  1709.   * $Log: code77230.c,v $
  1710.   * Revision 1.7  2010/04/17 13:14:22  alfred
  1711. - * - address overlapping strcpy()
  1712. + * - address overlapping custom_string_copy()
  1713.   *
  1714.   * Revision 1.6  2008/11/23 10:39:17  alfred
  1715.   * - allow strings with NUL characters
  1716. diff -uN asl-current/code78c10.c asl-newest/code78c10.c
  1717. --- asl-current/code78c10.c 2007-11-26 17:28:34.000000000 -0200
  1718. +++ asl-newest/code78c10.c  2013-12-18 21:08:58.247284814 -0200
  1719. @@ -666,9 +666,9 @@
  1720.        BEGIN
  1721.         if (strcasecmp(ArgStr[1],"EA")!=0)
  1722.          BEGIN
  1723. -         strcpy(ArgStr[3],ArgStr[1]);
  1724. -         strcpy(ArgStr[1],ArgStr[2]);
  1725. -         strcpy(ArgStr[2],ArgStr[3]);
  1726. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  1727. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  1728. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  1729.           OK=True;
  1730.          END
  1731.         else OK=False;
  1732. @@ -726,9 +726,9 @@
  1733.         BEGIN
  1734.          if (strcasecmp(ArgStr[1],"A")!=0)
  1735.           BEGIN
  1736. -          strcpy(ArgStr[3],ArgStr[1]);
  1737. -          strcpy(ArgStr[1],ArgStr[2]);
  1738. -          strcpy(ArgStr[2],ArgStr[3]);
  1739. +          custom_string_copy(ArgStr[3],ArgStr[1]);
  1740. +          custom_string_copy(ArgStr[1],ArgStr[2]);
  1741. +          custom_string_copy(ArgStr[2],ArgStr[3]);
  1742.            OK=False;
  1743.           END
  1744.          else OK=True;
  1745. diff -uN asl-current/code78k0.c asl-newest/code78k0.c
  1746. --- asl-current/code78k0.c  2010-08-27 11:52:42.000000000 -0300
  1747. +++ asl-newest/code78k0.c   2013-12-18 21:08:58.251284814 -0200
  1748. @@ -13,10 +13,10 @@
  1749.   *****************************************************************************
  1750.   * $Log: code78k0.c,v $
  1751.   * Revision 1.7  2010/08/27 14:52:42  alfred
  1752. - * - some more overlapping strcpy() cleanups
  1753. + * - some more overlapping custom_string_copy() cleanups
  1754.   *
  1755.   * Revision 1.6  2010/04/17 13:14:22  alfred
  1756. - * - address overlapping strcpy()
  1757. + * - address overlapping custom_string_copy()
  1758.   *
  1759.   * Revision 1.5  2007/11/24 22:48:05  alfred
  1760.   * - some NetBSD changes
  1761. @@ -475,9 +475,9 @@
  1762.    {
  1763.      if ((strcasecmp(ArgStr[2], "A") == 0) || (strcasecmp(ArgStr[2], "RP1") == 0))
  1764.      {
  1765. -      strcpy(ArgStr[3], ArgStr[1]);
  1766. -      strcpy(ArgStr[1], ArgStr[2]);
  1767. -      strcpy(ArgStr[2], ArgStr[3]);
  1768. +      custom_string_copy(ArgStr[3], ArgStr[1]);
  1769. +      custom_string_copy(ArgStr[1], ArgStr[2]);
  1770. +      custom_string_copy(ArgStr[2], ArgStr[3]);
  1771.      }
  1772.      DecodeAdr(ArgStr[1], MModReg8);
  1773.      if (AdrMode != ModNone)
  1774. @@ -882,9 +882,9 @@
  1775.    {
  1776.      if (!strcasecmp(ArgStr[2], "CY"))
  1777.      {
  1778. -      strcpy(ArgStr[3], ArgStr[1]);
  1779. -      strcpy(ArgStr[1], ArgStr[2]);
  1780. -      strcpy(ArgStr[2], ArgStr[3]);
  1781. +      custom_string_copy(ArgStr[3], ArgStr[1]);
  1782. +      custom_string_copy(ArgStr[1], ArgStr[2]);
  1783. +      custom_string_copy(ArgStr[2], ArgStr[3]);
  1784.        z = 1;
  1785.      }
  1786.      else z = 4;
  1787. diff -uN asl-current/code8008.c asl-newest/code8008.c
  1788. --- asl-current/code8008.c  2012-09-16 15:49:23.000000000 -0300
  1789. +++ asl-newest/code8008.c   2013-12-18 21:08:58.251284814 -0200
  1790. @@ -267,7 +267,7 @@
  1791.    char Memo[10], *p;
  1792.    int z;
  1793.  
  1794. -  strcpy(Memo, NName); p = strchr(Memo, '*');
  1795. +  custom_string_copy(Memo, NName); p = strchr(Memo, '*');
  1796.    for (z = 0; z < 8; z++)
  1797.    {
  1798.      *p = RegNames[z];
  1799. @@ -285,7 +285,7 @@
  1800.    char Memo[10], *p;
  1801.    int z;
  1802.  
  1803. -  strcpy(Memo, NName); p = strchr(Memo, '*');
  1804. +  custom_string_copy(Memo, NName); p = strchr(Memo, '*');
  1805.    for (z = 0; z < 8; z++)
  1806.    {
  1807.      *p = RegNames[z];
  1808. @@ -303,7 +303,7 @@
  1809.    char Memo[10], *p;
  1810.    int z;
  1811.    
  1812. -  strcpy(Memo, NName); p = strchr(Memo, '*');
  1813. +  custom_string_copy(Memo, NName); p = strchr(Memo, '*');
  1814.    for (z = 0; z < 4; z++)
  1815.    {
  1816.      *p = FlagNames[z];  
  1817. diff -uN asl-current/code807x.c asl-newest/code807x.c
  1818. --- asl-current/code807x.c  2005-09-08 13:53:42.000000000 -0300
  1819. +++ asl-newest/code807x.c   2013-12-18 21:08:58.251284814 -0200
  1820. @@ -658,7 +658,7 @@
  1821.    /* allow both syntaxes for PC-relative addressing */
  1822.  
  1823.    if (ArgCnt == 1)
  1824. -    strcpy(ArgStr[++ArgCnt], "PC");
  1825. +    custom_string_copy(ArgStr[++ArgCnt], "PC");
  1826.  
  1827.    if (ArgCnt != 2) WrError(1110);
  1828.    else
  1829. diff -uN asl-current/code85.c asl-newest/code85.c
  1830. --- asl-current/code85.c    2007-11-25 09:47:29.000000000 -0200
  1831. +++ asl-newest/code85.c 2013-12-18 21:08:58.251284814 -0200
  1832. @@ -345,7 +345,7 @@
  1833.    UNUSED(Index);
  1834.  
  1835.    if (!ArgCnt)
  1836. -    strcpy(ArgStr[++ArgCnt], "B");
  1837. +    custom_string_copy(ArgStr[++ArgCnt], "B");
  1838.  
  1839.    if (ArgCnt != 1) WrError(1110);
  1840.    else if (MomCPU < CPU8085U) WrError(1500);
  1841. @@ -364,7 +364,7 @@
  1842.    UNUSED(Index);
  1843.  
  1844.    if (!ArgCnt)
  1845. -    strcpy(ArgStr[++ArgCnt], "D");
  1846. +    custom_string_copy(ArgStr[++ArgCnt], "D");
  1847.  
  1848.    if (ArgCnt != 1) WrError(1110);
  1849.    else if (MomCPU < CPU8085U) WrError(1500);
  1850. diff -uN asl-current/code86.c asl-newest/code86.c
  1851. --- asl-current/code86.c    2010-08-27 11:52:42.000000000 -0300
  1852. +++ asl-newest/code86.c 2013-12-18 21:08:58.251284814 -0200
  1853. @@ -14,10 +14,10 @@
  1854.  /*****************************************************************************
  1855.   * $Log: code86.c,v $
  1856.   * Revision 1.7  2010/08/27 14:52:42  alfred
  1857. - * - some more overlapping strcpy() cleanups
  1858. + * - some more overlapping custom_string_copy() cleanups
  1859.   *
  1860.   * Revision 1.6  2010/04/17 13:14:22  alfred
  1861. - * - address overlapping strcpy()
  1862. + * - address overlapping custom_string_copy()
  1863.   *
  1864.   * Revision 1.5  2008/04/06 09:37:52  alfred
  1865.   * - catch immediate addressing on invalid operand size, some reformatting
  1866. @@ -381,7 +381,7 @@
  1867.          }
  1868.          else
  1869.          {
  1870. -          *p = '\0'; strcpy(AddPart, AdrPart); strmov(AdrPart, p + 1);
  1871. +          *p = '\0'; custom_string_copy(AddPart, AdrPart); strmov(AdrPart, p + 1);
  1872.          }
  1873.  
  1874.          if (!strcasecmp(AddPart, "BX"))
  1875. @@ -675,7 +675,7 @@
  1876.      BEGIN
  1877.       if (Index!=0)
  1878.        BEGIN
  1879. -       strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  1880. +       custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  1881.        END
  1882.       DecodeAdr(ArgStr[1]);
  1883.       switch (AdrType)
  1884. @@ -1843,7 +1843,7 @@
  1885.        END
  1886.       if (ArgCnt==1)
  1887.        BEGIN
  1888. -       strcpy (ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
  1889. +       custom_string_copy (ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
  1890.        END
  1891.       if (ArgCnt!=2) WrError(1110);
  1892.       else
  1893. @@ -1902,7 +1902,7 @@
  1894.       OpAdd=0; if (FMemo("FIIMUL")) OpAdd+=8;
  1895.       if (ArgCnt==1)
  1896.        BEGIN
  1897. -       ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
  1898. +       ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
  1899.        END
  1900.       if (ArgCnt!=2) WrError(1110);
  1901.       else
  1902. @@ -1982,7 +1982,7 @@
  1903.        END
  1904.       if (ArgCnt==1)
  1905.        BEGIN
  1906. -       strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
  1907. +       custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255); ArgCnt++;
  1908.        END
  1909.       if (ArgCnt!=2) WrError(1110);
  1910.       else
  1911. @@ -2050,7 +2050,7 @@
  1912.       if ((FMemo("FIDIV")) OR (Memo("FIDIVR"))) OpAdd+=16;
  1913.       if (ArgCnt==1)
  1914.        BEGIN
  1915. -       ArgCnt=2; strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
  1916. +       ArgCnt=2; custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"ST",255);
  1917.        END
  1918.       if (ArgCnt!=2) WrError(1110);
  1919.       else
  1920. @@ -2273,7 +2273,7 @@
  1921.            BEGIN
  1922.             if (ArgCnt==2)
  1923.              BEGIN
  1924. -             strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]); ArgCnt++;
  1925. +             custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]); ArgCnt++;
  1926.              END
  1927.             BAsmCode[CodeLen]=0x69;
  1928.             DecodeAdr(ArgStr[1]);
  1929. diff -uN asl-current/code87c800.c asl-newest/code87c800.c
  1930. --- asl-current/code87c800.c    2010-04-17 10:14:22.000000000 -0300
  1931. +++ asl-newest/code87c800.c 2013-12-18 21:08:58.251284814 -0200
  1932. @@ -13,7 +13,7 @@
  1933.  /*****************************************************************************
  1934.   * $Log: code87c800.c,v $
  1935.   * Revision 1.5  2010/04/17 13:14:22  alfred
  1936. - * - address overlapping strcpy()
  1937. + * - address overlapping custom_string_copy()
  1938.   *
  1939.   * Revision 1.4  2007/11/24 22:48:05  alfred
  1940.   * - some NetBSD changes
  1941. diff -uN asl-current/code8x30x.c asl-newest/code8x30x.c
  1942. --- asl-current/code8x30x.c 2007-11-25 09:47:29.000000000 -0200
  1943. +++ asl-newest/code8x30x.c  2013-12-18 21:08:58.251284814 -0200
  1944. @@ -343,7 +343,7 @@
  1945.              p=HasDisp(ArgStr[1]); /* kann eine Rotation dabei sein */
  1946.              if (p!=Nil)
  1947.               BEGIN                 /* jau! */
  1948. -              strcpy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
  1949. +              custom_string_copy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
  1950.                Rot=EvalIntExpression(tmp,UInt3,&OK);
  1951.                if (OK)
  1952.                 BEGIN
  1953. @@ -427,7 +427,7 @@
  1954.         if (p==Nil) WrError(1350);
  1955.         else
  1956.          BEGIN
  1957. -         strcpy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
  1958. +         custom_string_copy(tmp,p+1); tmp[strlen(tmp)-1]='\0';
  1959.           if (DecodeReg(tmp,&SrcReg,&SrcLen))
  1960.            BEGIN
  1961.             *p='\0';
  1962. diff -uN asl-current/code90c141.c asl-newest/code90c141.c
  1963. --- asl-current/code90c141.c    2010-04-17 10:14:23.000000000 -0300
  1964. +++ asl-newest/code90c141.c 2013-12-18 21:08:58.251284814 -0200
  1965. @@ -13,7 +13,7 @@
  1966.  /*****************************************************************************
  1967.   * $Log: code90c141.c,v $
  1968.   * Revision 1.4  2010/04/17 13:14:23  alfred
  1969. - * - address overlapping strcpy()
  1970. + * - address overlapping custom_string_copy()
  1971.   *
  1972.   * Revision 1.3  2006/08/05 12:05:37  alfred
  1973.   * - regard spaces in indexed expressions
  1974. diff -uN asl-current/code960.c asl-newest/code960.c
  1975. --- asl-current/code960.c   2010-04-17 10:14:23.000000000 -0300
  1976. +++ asl-newest/code960.c    2013-12-18 21:08:58.255284815 -0200
  1977. @@ -24,7 +24,7 @@
  1978.  /*****************************************************************************
  1979.   * $Log: code960.c,v $
  1980.   * Revision 1.6  2010/04/17 13:14:23  alfred
  1981. - * - address overlapping strcpy()
  1982. + * - address overlapping custom_string_copy()
  1983.   *
  1984.   * Revision 1.5  2007/11/24 22:48:06  alfred
  1985.   * - some NetBSD changes
  1986. @@ -330,7 +330,7 @@
  1987.  
  1988.     if ((Op->DestType!=NoneOp) AND (ArgCnt==1+Ord(Op->Src2Type!=NoneOp)))
  1989.      BEGIN
  1990. -     strcpy(ArgStr[ArgCnt+1],ArgStr[ArgCnt]);
  1991. +     custom_string_copy(ArgStr[ArgCnt+1],ArgStr[ArgCnt]);
  1992.       ArgCnt++;
  1993.      END
  1994.  
  1995. diff -uN asl-current/code96c141.c asl-newest/code96c141.c
  1996. --- asl-current/code96c141.c    2010-08-27 11:52:42.000000000 -0300
  1997. +++ asl-newest/code96c141.c 2013-12-18 21:08:58.255284815 -0200
  1998. @@ -18,7 +18,7 @@
  1999.  /*****************************************************************************
  2000.   * $Log: code96c141.c,v $
  2001.   * Revision 1.9  2010/08/27 14:52:42  alfred
  2002. - * - some more overlapping strcpy() cleanups
  2003. + * - some more overlapping custom_string_copy() cleanups
  2004.   *
  2005.   * Revision 1.8  2007/11/24 22:48:06  alfred
  2006.   * - some NetBSD changes
  2007. @@ -231,7 +231,7 @@
  2008.  
  2009.     if ((l == 4) AND ((*Asc == 'Q') OR (*Asc == 'R')) AND ((Asc[3] >= '0') AND (Asc[3] <= '7')))
  2010.      BEGIN
  2011. -     strcpy(HAsc, Asc + 1); HAsc[2] = '\0';
  2012. +     custom_string_copy(HAsc, Asc + 1); HAsc[2] = '\0';
  2013.       for (z = 0; z < RegCnt >> 1; z++)
  2014.        if (strcmp(HAsc, Reg16Names[z]) == 0)
  2015.         BEGIN
  2016. @@ -294,7 +294,7 @@
  2017.     if (((l == 3) OR ((l == 4) AND (*Asc == 'Q')))
  2018.     AND ((Asc[l - 1] == 'L') OR (Asc[l - 1] == 'H')))
  2019.      BEGIN
  2020. -     strcpy(HAsc, Asc + (l - 3)); HAsc[2] = '\0';
  2021. +     custom_string_copy(HAsc, Asc + (l - 3)); HAsc[2] = '\0';
  2022.       for (z = 0; z < RegCnt >> 1; z++)
  2023.        if (strcmp(HAsc, Reg16Names[z + 4]) == 0)
  2024.         BEGIN
  2025. @@ -318,7 +318,7 @@
  2026.  
  2027.     if (((l == 3) OR ((l == 4) AND (*Asc == 'Q'))) AND (IsQuot(Asc[l - 1])))
  2028.      BEGIN
  2029. -     strcpy(HAsc, Asc + 1); HAsc[l - 2] = '\0';
  2030. +     custom_string_copy(HAsc, Asc + 1); HAsc[l - 2] = '\0';
  2031.       for (z = 0; z < RegCnt >> 1; z++)
  2032.        if (strcmp(HAsc, Reg16Names[z]) == 0)
  2033.         BEGIN
  2034. @@ -332,7 +332,7 @@
  2035.  
  2036.     if ((l == 4) AND (IsQuot(Asc[3])))
  2037.      BEGIN
  2038. -     strcpy(HAsc, Asc); HAsc[3] = '\0';
  2039. +     custom_string_copy(HAsc, Asc); HAsc[3] = '\0';
  2040.       for (z = 0; z < RegCnt >> 1; z++)
  2041.        if (strcmp(HAsc, Reg32Names[z]) == 0)
  2042.         BEGIN
  2043. @@ -484,7 +484,7 @@
  2044.  
  2045.     if ((strlen(Asc)>4) AND (Asc[strlen(Asc)-1]==')') AND (strncmp(Asc,"(-",2)==0))
  2046.      BEGIN
  2047. -     strcpy(HAsc,Asc+2); HAsc[strlen(HAsc)-1]='\0';
  2048. +     custom_string_copy(HAsc,Asc+2); HAsc[strlen(HAsc)-1]='\0';
  2049.       if (CodeEReg(HAsc,&HNum,&HSize)!=2) WrError(1350);
  2050.       else if (NOT IsRegBase(HNum,HSize)) WrError(1350);
  2051.       else
  2052. @@ -499,7 +499,7 @@
  2053.  
  2054.     if ((strlen(Asc)>4) AND (Asc[0]=='(') AND (strncmp(Asc+strlen(Asc)-2,"+)",2)==0))
  2055.      BEGIN
  2056. -     strcpy(HAsc,Asc+1); HAsc[strlen(HAsc)-2]='\0';
  2057. +     custom_string_copy(HAsc,Asc+1); HAsc[strlen(HAsc)-2]='\0';
  2058.       if (CodeEReg(HAsc,&HNum,&HSize)!=2) WrError(1350);
  2059.       else if (NOT IsRegBase(HNum,HSize)) WrError(1350);
  2060.       else
  2061. @@ -516,7 +516,7 @@
  2062.      BEGIN
  2063.       NegFlag=False; NNegFlag=False; FirstFlag=False;
  2064.       PartMask=0; DispAcc=0; BaseReg=IndReg=BaseSize=IndSize=0xff;
  2065. -     strcpy(Rest,Asc+1); Rest[strlen(Rest)-1]='\0';
  2066. +     custom_string_copy(Rest,Asc+1); Rest[strlen(Rest)-1]='\0';
  2067.  
  2068.       do
  2069.        BEGIN
  2070. @@ -535,7 +535,7 @@
  2071.           WrError(1350); return;
  2072.          END
  2073.         strncpy(HAsc,Rest,EPos-Rest); HAsc[EPos-Rest]='\0';
  2074. -       if (EPos<Rest+strlen(Rest)) strcpy(Rest,EPos+1); else *Rest='\0';
  2075. +       if (EPos<Rest+strlen(Rest)) custom_string_copy(Rest,EPos+1); else *Rest='\0';
  2076.         KillPrefBlanks(HAsc); KillPostBlanks(HAsc);
  2077.  
  2078.         switch (CodeEReg(HAsc,&HNum,&HSize))
  2079. diff -uN asl-current/code97c241.c asl-newest/code97c241.c
  2080. --- asl-current/code97c241.c    2010-04-17 10:14:23.000000000 -0300
  2081. +++ asl-newest/code97c241.c 2013-12-18 21:08:58.255284815 -0200
  2082. @@ -13,7 +13,7 @@
  2083.  /*****************************************************************************
  2084.   * $Log: code97c241.c,v $
  2085.   * Revision 1.7  2010/04/17 13:14:23  alfred
  2086. - * - address overlapping strcpy()
  2087. + * - address overlapping custom_string_copy()
  2088.   *
  2089.   * Revision 1.6  2007/11/24 22:48:06  alfred
  2090.   * - some NetBSD changes
  2091. @@ -504,7 +504,7 @@
  2092.         EPos=QuotPos(AdrPart,'*');
  2093.         if (EPos!=Nil)
  2094.          BEGIN
  2095. -         strcpy(tmp,AdrPart); tmp[EPos-AdrPart]='\0';
  2096. +         custom_string_copy(tmp,AdrPart); tmp[EPos-AdrPart]='\0';
  2097.          END
  2098.         l=strlen(AdrPart);
  2099.         if ((EPos==AdrPart+l-2)
  2100. @@ -1219,7 +1219,7 @@
  2101.        else
  2102.         BEGIN
  2103.          if (p==AttrPart) Format=' '; else Format=(*AttrPart);
  2104. -        strcpy(AttrPart,p+1);
  2105. +        custom_string_copy(AttrPart,p+1);
  2106.         END
  2107.        break;
  2108.       default:
  2109. @@ -1272,7 +1272,7 @@
  2110.         BEGIN
  2111.          if ((NOT IsIndirect(ArgStr[1])) AND ((RMWOrders[z].Mask & 0x20)!=0))
  2112.           BEGIN
  2113. -          sprintf(ArgStr[2],"(%s)",ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]);
  2114. +          sprintf(ArgStr[2],"(%s)",ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]);
  2115.           END
  2116.          DecodeAdr(ArgStr[1],0,(RMWOrders[z].Mask & 0x10)==0,(RMWOrders[z].Mask & 0x20)==0);
  2117.          if (AdrOK)
  2118. @@ -1476,9 +1476,9 @@
  2119.         BEGIN
  2120.          if (z==2)
  2121.           BEGIN
  2122. -          strcpy(ArgStr[5],ArgStr[1]);
  2123. -          strcpy(ArgStr[1],ArgStr[2]);
  2124. -          strcpy(ArgStr[2],ArgStr[5]);
  2125. +          custom_string_copy(ArgStr[5],ArgStr[1]);
  2126. +          custom_string_copy(ArgStr[1],ArgStr[2]);
  2127. +          custom_string_copy(ArgStr[2],ArgStr[5]);
  2128.           END
  2129.          if (NOT DecodeReg(ArgStr[1],&Reg)) WrError(1350);
  2130.          else if ((Reg >> 6)!=1) WrError(1130);
  2131. diff -uN asl-current/codeace.c asl-newest/codeace.c
  2132. --- asl-current/codeace.c   2010-04-17 10:14:23.000000000 -0300
  2133. +++ asl-newest/codeace.c    2013-12-18 21:08:58.255284815 -0200
  2134. @@ -21,7 +21,7 @@
  2135.  /*****************************************************************************
  2136.   * $Log: codeace.c,v $
  2137.   * Revision 1.4  2010/04/17 13:14:23  alfred
  2138. - * - address overlapping strcpy()
  2139. + * - address overlapping custom_string_copy()
  2140.   *
  2141.   * Revision 1.3  2005/09/08 16:53:42  alfred
  2142.   * - use common PInstTable
  2143. diff -uN asl-current/codecop8.c asl-newest/codecop8.c
  2144. --- asl-current/codecop8.c  2006-04-09 09:40:11.000000000 -0300
  2145. +++ asl-newest/codecop8.c   2013-12-18 21:08:58.255284815 -0200
  2146. @@ -333,7 +333,7 @@
  2147.        BEGIN
  2148.         if (strcasecmp(ArgStr[1],"A")!=0)
  2149.          BEGIN
  2150. -         strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  2151. +         custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  2152.          END
  2153.         DecodeAdr(ArgStr[1],MModAcc);
  2154.         if (AdrMode!=ModNone)
  2155. diff -uN asl-current/codeh8_3.c asl-newest/codeh8_3.c
  2156. --- asl-current/codeh8_3.c  2011-08-01 16:56:08.000000000 -0300
  2157. +++ asl-newest/codeh8_3.c   2013-12-18 21:08:58.259284815 -0200
  2158. @@ -17,10 +17,10 @@
  2159.   * - add attribute type to error message
  2160.   *
  2161.   * Revision 1.6  2010/08/27 14:52:42  alfred
  2162. - * - some more overlapping strcpy() cleanups
  2163. + * - some more overlapping custom_string_copy() cleanups
  2164.   *
  2165.   * Revision 1.5  2010/04/17 13:14:23  alfred
  2166. - * - address overlapping strcpy()
  2167. + * - address overlapping custom_string_copy()
  2168.   *
  2169.   * Revision 1.4  2007/11/24 22:48:06  alfred
  2170.   * - some NetBSD changes
  2171. @@ -966,8 +966,8 @@
  2172.        BEGIN
  2173.         if (Memo("MOVTPE"))
  2174.          BEGIN
  2175. -         strcpy(ArgStr[3],ArgStr[2]); strcpy(ArgStr[2],ArgStr[1]);
  2176. -         strcpy(ArgStr[1],ArgStr[3]);
  2177. +         custom_string_copy(ArgStr[3],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[1]);
  2178. +         custom_string_copy(ArgStr[1],ArgStr[3]);
  2179.          END
  2180.         DecodeAdr(ArgStr[2],MModReg);
  2181.         if (AdrMode!=ModNone)
  2182. @@ -1016,8 +1016,8 @@
  2183.        BEGIN
  2184.         if (Memo("STC"))
  2185.          BEGIN
  2186. -         strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]);
  2187. -         strcpy(ArgStr[2],ArgStr[3]);
  2188. +         custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]);
  2189. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  2190.           z=0x80;
  2191.          END
  2192.         else z=0;
  2193. diff -uN asl-current/codeh8_5.c asl-newest/codeh8_5.c
  2194. --- asl-current/codeh8_5.c  2010-04-17 10:14:23.000000000 -0300
  2195. +++ asl-newest/codeh8_5.c   2013-12-18 21:08:58.259284815 -0200
  2196. @@ -13,7 +13,7 @@
  2197.  /*****************************************************************************
  2198.   * $Log: codeh8_5.c,v $
  2199.   * Revision 1.8  2010/04/17 13:14:23  alfred
  2200. - * - address overlapping strcpy()
  2201. + * - address overlapping custom_string_copy()
  2202.   *
  2203.   * Revision 1.7  2009/12/21 21:07:15  alfred
  2204.   * - allow unsigned 16 bit displacements
  2205. @@ -1488,11 +1488,11 @@
  2206.          if (p < AttrPart + strlen(AttrPart) - 1)
  2207.            strmaxcpy(Format, p + 1, STRINGSIZE - 1);
  2208.          else
  2209. -          strcpy(Format, " ");
  2210. +          custom_string_copy(Format, " ");
  2211.          *p = '\0';
  2212.        }
  2213.        else
  2214. -        strcpy(Format, " ");
  2215. +        custom_string_copy(Format, " ");
  2216.        break;
  2217.      case ':':
  2218.        p = strchr(AttrPart, '.');
  2219. @@ -1505,14 +1505,14 @@
  2220.        {
  2221.          *p = '\0';
  2222.          if (p == AttrPart)
  2223. -          strcpy(Format, " ");
  2224. +          custom_string_copy(Format, " ");
  2225.          else
  2226.            strmaxcpy(Format, AttrPart, STRINGSIZE - 1);
  2227. -        strcpy(AttrPart, p + 1);
  2228. +        custom_string_copy(AttrPart, p + 1);
  2229.        }
  2230.        break;
  2231.      default:
  2232. -      strcpy(Format, " ");
  2233. +      custom_string_copy(Format, " ");
  2234.    }
  2235.  
  2236.    /* Attribut abarbeiten */
  2237. diff -uN asl-current/codem16.c asl-newest/codem16.c
  2238. --- asl-current/codem16.c   2010-08-27 11:52:42.000000000 -0300
  2239. +++ asl-newest/codem16.c    2013-12-18 21:08:58.259284815 -0200
  2240. @@ -13,7 +13,7 @@
  2241.  /*****************************************************************************
  2242.   * $Log: codem16.c,v $
  2243.   * Revision 1.6  2010/08/27 14:52:42  alfred
  2244. - * - some more overlapping strcpy() cleanups
  2245. + * - some more overlapping custom_string_copy() cleanups
  2246.   *
  2247.   * Revision 1.5  2007/11/24 22:48:07  alfred
  2248.   * - some NetBSD changes
  2249. @@ -430,7 +430,7 @@
  2250.         *p='\0'; strmaxcpy(Part,Asc,255); strmov(Asc,p+1);
  2251.        END
  2252.  
  2253. -     strcpy(SReg,Part); p=QuotPos(SReg,'*'); if (p!=Nil) *p='\0';
  2254. +     custom_string_copy(SReg,Part); p=QuotPos(SReg,'*'); if (p!=Nil) *p='\0';
  2255.  
  2256.       /* weitere Indirektion ? */
  2257.  
  2258. @@ -1120,7 +1120,7 @@
  2259.        BEGIN
  2260.         if (OptionCnt<2)
  2261.          BEGIN
  2262. -         for (z=OptionCnt-1; z>=0; z--) strcpy(Options[z+1],Options[z]);
  2263. +         for (z=OptionCnt-1; z>=0; z--) custom_string_copy(Options[z+1],Options[z]);
  2264.           OptionCnt++; strmaxcpy(Options[0],p+1,255);
  2265.          END
  2266.         *p='\0';
  2267. @@ -1473,7 +1473,7 @@
  2268.     for (z=0; z<MulOrderCount; z++)
  2269.      if (Memo(MulOrders[z]))
  2270.       BEGIN
  2271. -      strcpy(Form,(Odd(z)) ? "GE" : "GER");
  2272. +      custom_string_copy(Form,(Odd(z)) ? "GE" : "GER");
  2273.        if (ArgCnt!=2) WrError(1110);
  2274.        else if (CheckFormat(Form))
  2275.         if (GetOpSize(ArgStr[1],1))
  2276. @@ -1709,7 +1709,7 @@
  2277.     for (z=0; z<BitOrderCount; z++)
  2278.      if (Memo(BitOrders[z].Name))
  2279.       BEGIN
  2280. -      strcpy(Form,(BitOrders[z].Code2!=0) ? "GER" : "GE");
  2281. +      custom_string_copy(Form,(BitOrders[z].Code2!=0) ? "GER" : "GE");
  2282.        if (ArgCnt!=2) WrError(1110);
  2283.        else if (CheckFormat(Form))
  2284.         if (GetOpSize(ArgStr[1],1))
  2285. @@ -1998,10 +1998,10 @@
  2286.        if (p!=Nil)
  2287.         BEGIN
  2288.          if (p<AttrPart+strlen(AttrPart)-1) strmaxcpy(Format,p+1,STRINGSIZE-1);
  2289. -        else strcpy(Format," ");
  2290. +        else custom_string_copy(Format," ");
  2291.          *p='\0';
  2292.         END
  2293. -      else strcpy(Format," ");
  2294. +      else custom_string_copy(Format," ");
  2295.        break;
  2296.       case ':':
  2297.        p=strchr(AttrPart,'.');
  2298. @@ -2012,11 +2012,11 @@
  2299.        else
  2300.         BEGIN
  2301.          *p='\0';
  2302. -        if (p==AttrPart) strcpy(Format," "); else strmaxcpy(Format,AttrPart,STRINGSIZE-1);
  2303. +        if (p==AttrPart) custom_string_copy(Format," "); else strmaxcpy(Format,AttrPart,STRINGSIZE-1);
  2304.         END
  2305.        break;
  2306.       default:
  2307. -      strcpy(Format," ");
  2308. +      custom_string_copy(Format," ");
  2309.      END
  2310.     NLS_UpString(Format);
  2311.  
  2312. @@ -2574,9 +2574,9 @@
  2313.       if (Memo("EXITD"))
  2314.        BEGIN
  2315.         z=1;
  2316. -       strcpy(ArgStr[3],ArgStr[1]);
  2317. -       strcpy(ArgStr[1],ArgStr[2]);
  2318. -       strcpy(ArgStr[2],ArgStr[3]);
  2319. +       custom_string_copy(ArgStr[3],ArgStr[1]);
  2320. +       custom_string_copy(ArgStr[1],ArgStr[2]);
  2321. +       custom_string_copy(ArgStr[2],ArgStr[3]);
  2322.        END
  2323.       else z=0;
  2324.       if (ArgCnt!=2) WrError(1110);
  2325. @@ -2668,11 +2668,11 @@
  2326.         SplitOptions();
  2327.         if (strcasecmp(Options[0],"F")==0)
  2328.          BEGIN
  2329. -         Mask=0; strcpy(Options[0],Options[1]); OptionCnt--;
  2330. +         Mask=0; custom_string_copy(Options[0],Options[1]); OptionCnt--;
  2331.          END
  2332.         else if (strcasecmp(Options[0],"B")==0)
  2333.          BEGIN
  2334. -         Mask=1; strcpy(Options[0],Options[1]); OptionCnt--;
  2335. +         Mask=1; custom_string_copy(Options[0],Options[1]); OptionCnt--;
  2336.          END
  2337.         else if (strcasecmp(Options[1],"F")==0)
  2338.          BEGIN
  2339. @@ -2719,7 +2719,7 @@
  2340.       if (Memo("LDM"))
  2341.        BEGIN
  2342.         z=0x1000; Mask+=MModPop;
  2343. -       strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  2344. +       custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  2345.        END
  2346.       else
  2347.        BEGIN
  2348. diff -uN asl-current/codem16c.c asl-newest/codem16c.c
  2349. --- asl-current/codem16c.c  2010-04-11 08:38:43.000000000 -0300
  2350. +++ asl-newest/codem16c.c   2013-12-18 21:08:58.259284815 -0200
  2351. @@ -919,9 +919,9 @@
  2352.        BEGIN
  2353.         if (Memo("STC"))
  2354.          BEGIN
  2355. -         strcpy(ArgStr[3],ArgStr[1]);
  2356. -         strcpy(ArgStr[1],ArgStr[2]);
  2357. -         strcpy(ArgStr[2],ArgStr[3]);
  2358. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  2359. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  2360. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  2361.           z=1;
  2362.          END
  2363.         else z=0;
  2364. @@ -994,9 +994,9 @@
  2365.        BEGIN
  2366.         if (Memo("LDE"))
  2367.          BEGIN
  2368. -         strcpy(ArgStr[3],ArgStr[1]);
  2369. -         strcpy(ArgStr[1],ArgStr[2]);
  2370. -         strcpy(ArgStr[2],ArgStr[3]);
  2371. +         custom_string_copy(ArgStr[3],ArgStr[1]);
  2372. +         custom_string_copy(ArgStr[1],ArgStr[2]);
  2373. +         custom_string_copy(ArgStr[2],ArgStr[3]);
  2374.           z=1;
  2375.          END
  2376.         else z=0;
  2377. @@ -1323,7 +1323,7 @@
  2378.          if (p<AttrPart+strlen(AttrPart)-1) strmaxcpy(Format,p+1,STRINGSIZE-1);
  2379.          *p='\0';
  2380.         END
  2381. -      else strcpy(Format," ");
  2382. +      else custom_string_copy(Format," ");
  2383.        break;
  2384.       case ':':
  2385.        p=strchr(AttrPart,'.');
  2386. @@ -1338,7 +1338,7 @@
  2387.         END
  2388.        break;
  2389.       default:
  2390. -      strcpy(Format," ");
  2391. +      custom_string_copy(Format," ");
  2392.      END
  2393.  
  2394.     /* Attribut abarbeiten */
  2395. diff -uN asl-current/codescmp.c asl-newest/codescmp.c
  2396. --- asl-current/codescmp.c  2013-03-07 17:10:11.000000000 -0300
  2397. +++ asl-newest/codescmp.c   2013-12-18 21:08:58.259284815 -0200
  2398. @@ -16,7 +16,7 @@
  2399.   * - correct PC-relative addressing for SC/MP
  2400.   *
  2401.   * Revision 1.6  2010/04/17 13:14:23  alfred
  2402. - * - address overlapping strcpy()
  2403. + * - address overlapping custom_string_copy()
  2404.   *
  2405.   * Revision 1.5  2009/04/13 07:36:50  alfred
  2406.   * - clean up SC/MP target, correct PC-relative addressing
  2407. diff -uN asl-current/codest7.c asl-newest/codest7.c
  2408. --- asl-current/codest7.c   2010-04-17 10:14:23.000000000 -0300
  2409. +++ asl-newest/codest7.c    2013-12-18 21:08:58.263284815 -0200
  2410. @@ -13,7 +13,7 @@
  2411.  /*****************************************************************************
  2412.   * $Log: codest7.c,v $
  2413.   * Revision 1.5  2010/04/17 13:14:23  alfred
  2414. - * - address overlapping strcpy()
  2415. + * - address overlapping custom_string_copy()
  2416.   *
  2417.   * Revision 1.4  2007/11/24 22:48:07  alfred
  2418.   * - some NetBSD changes
  2419. diff -uN asl-current/codest9.c asl-newest/codest9.c
  2420. --- asl-current/codest9.c   2010-04-17 10:14:23.000000000 -0300
  2421. +++ asl-newest/codest9.c    2013-12-18 21:08:58.263284815 -0200
  2422. @@ -15,7 +15,7 @@
  2423.  /*****************************************************************************
  2424.   * $Log: codest9.c,v $
  2425.   * Revision 1.6  2010/04/17 13:14:23  alfred
  2426. - * - address overlapping strcpy()
  2427. + * - address overlapping custom_string_copy()
  2428.   *
  2429.   * Revision 1.5  2007/06/28 20:27:31  alfred
  2430.   * - silence some warnings on recent GNU C versions
  2431. @@ -401,7 +401,7 @@
  2432.  
  2433.     if (OK)
  2434.      BEGIN
  2435. -     strcpy(Reg,p+2); Reg[strlen(Reg)-1]='\0'; p[1]='\0';
  2436. +     custom_string_copy(Reg,p+2); Reg[strlen(Reg)-1]='\0'; p[1]='\0';
  2437.       if (DecodeReg(Reg,&AdrPart,&Size))
  2438.        if (Size==0)   /* d(r) */
  2439.         BEGIN
  2440. diff -uN asl-current/codexa.c asl-newest/codexa.c
  2441. --- asl-current/codexa.c    2010-04-17 10:14:24.000000000 -0300
  2442. +++ asl-newest/codexa.c 2013-12-18 21:08:58.263284815 -0200
  2443. @@ -23,7 +23,7 @@
  2444.  /*****************************************************************************
  2445.   * $Log: codexa.c,v $
  2446.   * Revision 1.6  2010/04/17 13:14:24  alfred
  2447. - * - address overlapping strcpy()
  2448. + * - address overlapping custom_string_copy()
  2449.   *
  2450.   * Revision 1.5  2007/11/24 22:48:07  alfred
  2451.   * - some NetBSD changes
  2452. diff -uN asl-current/codexgate.c asl-newest/codexgate.c
  2453. --- asl-current/codexgate.c 2010-04-17 10:14:24.000000000 -0300
  2454. +++ asl-newest/codexgate.c  2013-12-18 21:08:58.351284819 -0200
  2455. @@ -8,7 +8,7 @@
  2456.  /*****************************************************************************
  2457.   * $Log: codexgate.c,v $
  2458.   * Revision 1.6  2010/04/17 13:14:24  alfred
  2459. - * - address overlapping strcpy()
  2460. + * - address overlapping custom_string_copy()
  2461.   *
  2462.   * Revision 1.5  2007/11/24 22:48:08  alfred
  2463.   * - some NetBSD changes
  2464. diff -uN asl-current/codez80.c asl-newest/codez80.c
  2465. --- asl-current/codez80.c   2013-05-26 06:41:26.000000000 -0300
  2466. +++ asl-newest/codez80.c    2013-12-18 21:08:58.351284819 -0200
  2467. @@ -1293,7 +1293,7 @@
  2468.       BEGIN
  2469.        if (ArgCnt==1)
  2470.         BEGIN
  2471. -        strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); ArgCnt=2;
  2472. +        custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"A",255); ArgCnt=2;
  2473.         END
  2474.        if (ArgCnt!=2) WrError(1110);
  2475.        else if (strcasecmp(ArgStr[1],"HL")==0)
  2476. @@ -1806,7 +1806,7 @@
  2477.      BEGIN
  2478.       if (ArgCnt==1)
  2479.        BEGIN
  2480. -       strcpy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"HL",255); ArgCnt=2;
  2481. +       custom_string_copy(ArgStr[2],ArgStr[1]); strmaxcpy(ArgStr[1],"HL",255); ArgCnt=2;
  2482.        END
  2483.       if (MomCPU<CPUZ380) WrError(1500);
  2484.       else if (ArgCnt!=2) WrError(1110);
  2485. @@ -1947,17 +1947,17 @@
  2486.        /* copy out new opcode */
  2487.  
  2488.        *ptr = '\0';
  2489. -      strcpy(OpPart, ArgStr[1]);
  2490. +      custom_string_copy(OpPart, ArgStr[1]);
  2491.        NLS_UpString(OpPart);
  2492.  
  2493.        /* cut down arg or eliminate it completely */
  2494.  
  2495.        if (*ptr2)
  2496. -        strcpy(ArgStr[1], ptr2);
  2497. +        custom_string_copy(ArgStr[1], ptr2);
  2498.        else
  2499.        {
  2500.          for (z = 1; z < ArgCnt; z++)
  2501. -          strcpy(ArgStr[z], ArgStr[z + 1]);
  2502. +          custom_string_copy(ArgStr[z], ArgStr[z + 1]);
  2503.          ArgCnt--;
  2504.        }
  2505.      }
  2506. @@ -2276,7 +2276,7 @@
  2507.        BEGIN
  2508.         if (Memo("OUT"))
  2509.          BEGIN
  2510. -         strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  2511. +         custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  2512.          END
  2513.         if (strcasecmp(ArgStr[2],"(C)")==0)
  2514.          BEGIN
  2515. @@ -2331,7 +2331,7 @@
  2516.        BEGIN
  2517.         if (Memo("OUTW"))
  2518.          BEGIN
  2519. -         strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  2520. +         custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  2521.          END;
  2522.         if (strcasecmp(ArgStr[2],"(C)")!=0) WrError(1350);
  2523.         else
  2524. @@ -2378,7 +2378,7 @@
  2525.        BEGIN
  2526.         if (Memo("OUT0"))
  2527.          BEGIN
  2528. -         strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  2529. +         custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  2530.          END
  2531.         OpSize=0;
  2532.         if (ArgCnt==1)
  2533. @@ -2416,7 +2416,7 @@
  2534.        BEGIN
  2535.         if (*OpPart=='O')
  2536.          BEGIN
  2537. -         strcpy(ArgStr[3],ArgStr[1]); strcpy(ArgStr[1],ArgStr[2]); strcpy(ArgStr[2],ArgStr[3]);
  2538. +         custom_string_copy(ArgStr[3],ArgStr[1]); custom_string_copy(ArgStr[1],ArgStr[2]); custom_string_copy(ArgStr[2],ArgStr[3]);
  2539.          END
  2540.         OpSize=Ord(OpPart[strlen(OpPart)-1]=='W');
  2541.         if (((OpSize==0) AND (strcasecmp(ArgStr[1],"A")!=0))
  2542. diff -uN asl-current/codez8.c asl-newest/codez8.c
  2543. --- asl-current/codez8.c    2012-12-09 10:32:06.000000000 -0200
  2544. +++ asl-newest/codez8.c 2013-12-18 21:08:58.351284819 -0200
  2545. @@ -25,7 +25,7 @@
  2546.   * - allow arbitrary RP values on eZ8
  2547.   *
  2548.   * Revision 1.8  2010/04/17 13:14:24  alfred
  2549. - * - address overlapping strcpy()
  2550. + * - address overlapping custom_string_copy()
  2551.   *
  2552.   * Revision 1.7  2007/11/24 22:48:08  alfred
  2553.   * - some NetBSD changes
  2554. Common subdirectories: asl-current/doc_DE and asl-newest/doc_DE
  2555. Common subdirectories: asl-current/doc_EN and asl-newest/doc_EN
  2556. diff -uN asl-current/findhyphen.c asl-newest/findhyphen.c
  2557. --- asl-current/findhyphen.c    2007-12-31 11:51:06.000000000 -0200
  2558. +++ asl-newest/findhyphen.c 2013-12-18 21:08:58.351284819 -0200
  2559. @@ -103,7 +103,7 @@
  2560.  
  2561.     for (run=Patterns; *run!=NULL; run++)
  2562.      BEGIN
  2563. -     strcpy(sing,*run); rrun=sing;
  2564. +     custom_string_copy(sing,*run); rrun=sing;
  2565.       do
  2566.        BEGIN
  2567.         pos=strchr(rrun,' '); if (pos!=Nil) *pos='\0';
  2568. Common subdirectories: asl-current/include and asl-newest/include
  2569. diff -uN asl-current/Makefile.def asl-newest/Makefile.def
  2570. --- asl-current/Makefile.def    1969-12-31 21:00:00.000000000 -0300
  2571. +++ asl-newest/Makefile.def 2013-12-18 21:08:58.351284819 -0200
  2572. @@ -0,0 +1,31 @@
  2573. +# -------------------------------------------------------------------------
  2574. +# choose your compiler (must be ANSI-compliant!) and linker command, plus
  2575. +# any additionally needed flags
  2576. +
  2577. +CC = gcc
  2578. +LD = gcc
  2579. +CFLAGS = -O3 -fomit-frame-pointer -Wall
  2580. +LDFLAGS =
  2581. +
  2582. +TARG_OBJEXTENSION = .o
  2583. +TARG_EXEXTENSION =
  2584. +
  2585. +HOST_OBJEXTENSION = $(TARG_OBJEXTENSION)
  2586. +HOST_EXEXTENSION = $(TARG_EXEXTENSION)
  2587. +
  2588. +# -------------------------------------------------------------------------
  2589. +# directories where binaries, includes, and manpages should go during
  2590. +# installation
  2591. +
  2592. +BINDIR = /usr/local/bin
  2593. +INCDIR = /usr/local/include/asl
  2594. +MANDIR = /usr/local/man
  2595. +LIBDIR = /usr/local/lib/asl
  2596. +DOCDIR = /usr/local/doc/asl
  2597. +
  2598. +# -------------------------------------------------------------------------
  2599. +# character encoding to use (choose one of them)
  2600. +
  2601. +# CHARSET = CHARSET_ASCII7
  2602. +# CHARSET = CHARSET_IBM437
  2603. +CHARSET = CHARSET_ISO8859_1
  2604. Common subdirectories: asl-current/Makefile.def-samples and asl-newest/Makefile.def-samples
  2605. diff -uN asl-current/Makefile.dep asl-newest/Makefile.dep
  2606. --- asl-current/Makefile.dep    2013-08-07 18:04:36.000000000 -0300
  2607. +++ asl-newest/Makefile.dep 2013-12-18 21:12:40.855294043 -0200
  2608. @@ -230,7 +230,7 @@
  2609.  
  2610.  motpseudo.o: stdinc.h bpemu.h endian.h strutil.h asmdef.h asmsub.h asmpars.h asmitree.h asmallg.h motpseudo.h
  2611.  
  2612. -natpseudo.o: stdinc.h bpemu.h asmdef.h asmsub.h asmpars.h codepseudo.h natpseudo.h
  2613. +natpseudo.o: stdinc.h bpemu.h asmdef.h asmsub.h asmpars.h codepseudo.h natpseudo.h strutil.h
  2614.  
  2615.  nlmessages.o: stdinc.h strutil.h endian.h bpemu.h nls.h nlmessages.h
  2616.  
  2617. Common subdirectories: asl-current/man and asl-newest/man
  2618. diff -uN asl-current/motpseudo.c asl-newest/motpseudo.c
  2619. --- asl-current/motpseudo.c 2010-08-27 11:52:42.000000000 -0300
  2620. +++ asl-newest/motpseudo.c  2013-12-18 21:08:58.351284819 -0200
  2621. @@ -9,10 +9,10 @@
  2622.  /*****************************************************************************
  2623.   * $Log: motpseudo.c,v $
  2624.   * Revision 1.13  2010/08/27 14:52:42  alfred
  2625. - * - some more overlapping strcpy() cleanups
  2626. + * - some more overlapping custom_string_copy() cleanups
  2627.   *
  2628.   * Revision 1.12  2010/04/17 13:14:24  alfred
  2629. - * - address overlapping strcpy()
  2630. + * - address overlapping custom_string_copy()
  2631.   *
  2632.   * Revision 1.11  2010/03/14 11:40:19  alfred
  2633.   * silence compiler warning
  2634. @@ -421,12 +421,12 @@
  2635.    sprintf(s, "%0.16e", F); pSplit = strchr(s, 'e');
  2636.    if (!pSplit)
  2637.    {
  2638. -    strcpy(Man, s); strcpy(Exp, "+0000");
  2639. +    custom_string_copy(Man, s); custom_string_copy(Exp, "+0000");
  2640.    }
  2641.    else
  2642.    {
  2643.      *pSplit = '\0';
  2644. -    strcpy(Man, s); strcpy(Exp, pSplit + 1);
  2645. +    custom_string_copy(Man, s); custom_string_copy(Exp, pSplit + 1);
  2646.    }
  2647.  
  2648.    memset(pDest, 0, 12);
  2649. diff -uN asl-current/natpseudo.c asl-newest/natpseudo.c
  2650. --- asl-current/natpseudo.c 2006-04-09 10:24:17.000000000 -0300
  2651. +++ asl-newest/natpseudo.c  2013-12-18 21:08:58.351284819 -0200
  2652. @@ -27,6 +27,7 @@
  2653.  #include "codepseudo.h"
  2654.  
  2655.  #include "natpseudo.h"
  2656. +#include "strutil.h"
  2657.  
  2658.  /*****************************************************************************
  2659.   * Global Functions
  2660. @@ -47,21 +48,21 @@
  2661.  
  2662.    if (Memo("ADDR"))
  2663.    {
  2664. -    strcpy(OpPart, "DB");
  2665. +    custom_string_copy(OpPart, "DB");
  2666.      *pBigFlag = True;
  2667.    }
  2668.  
  2669.    if (Memo("ADDRW"))
  2670.    {
  2671. -    strcpy(OpPart, "DW");
  2672. +    custom_string_copy(OpPart, "DW");
  2673.      *pBigFlag = True;
  2674.    }
  2675.  
  2676.    if (Memo("BYTE"))
  2677. -    strcpy(OpPart, "DB");
  2678. +    custom_string_copy(OpPart, "DB");
  2679.  
  2680.    if (Memo("WORD"))
  2681. -    strcpy(OpPart,"DW");
  2682. +    custom_string_copy(OpPart,"DW");
  2683.  
  2684.    if ((Memo("DSB")) || (Memo("DSW")))
  2685.    {
  2686. diff -uN asl-current/nls.c asl-newest/nls.c
  2687. --- asl-current/nls.c   2010-08-27 11:52:43.000000000 -0300
  2688. +++ asl-newest/nls.c    2013-12-18 21:08:58.351284819 -0200
  2689. @@ -12,7 +12,7 @@
  2690.  /*****************************************************************************
  2691.   * $Log: nls.c,v $
  2692.   * Revision 1.2  2010/08/27 14:52:43  alfred
  2693. - * - some more overlapping strcpy() cleanups
  2694. + * - some more overlapping custom_string_copy() cleanups
  2695.   *
  2696.   * Revision 1.1  2003/11/06 02:49:24  alfred
  2697.   * - recreated
  2698. diff -uN asl-current/rescomp.c asl-newest/rescomp.c
  2699. --- asl-current/rescomp.c   2012-09-02 06:26:01.000000000 -0300
  2700. +++ asl-newest/rescomp.c    2013-12-18 21:08:58.355284819 -0200
  2701. @@ -209,10 +209,10 @@
  2702.      PCat->CtryCodeCnt = 0;
  2703.      for (p2 = p; ((*p2) && (!myisspace(*p2))); p2++);
  2704.      if (*p2 == '\0')
  2705. -      strcpy(Part, p);
  2706. +      custom_string_copy(Part, p);
  2707.      else
  2708.      {
  2709. -      *p2 = '\0'; strcpy(Part, p);
  2710. +      *p2 = '\0'; custom_string_copy(Part, p);
  2711.        for (p = p2 + 1; ((*p) && (isspace((unsigned int) *p2))); p++);
  2712.      }
  2713.      if ((!*Part) || (Part[strlen(Part)-1] != ')')) SynError(Part);
  2714. diff -uN asl-current/strutil.c asl-newest/strutil.c
  2715. --- asl-current/strutil.c   2013-08-07 16:44:38.000000000 -0300
  2716. +++ asl-newest/strutil.c    2013-12-18 21:12:24.619293370 -0200
  2717. @@ -24,7 +24,7 @@
  2718.   * - handle cases where strcpy is a macro
  2719.   *
  2720.   * Revision 1.7  2010/04/17 13:14:24  alfred
  2721. - * - address overlapping strcpy()
  2722. + * - address overlapping custom_string_copy()
  2723.   *
  2724.   * Revision 1.6  2008/11/23 10:39:17  alfred
  2725.   * - allow strings with NUL characters
  2726. @@ -193,7 +193,7 @@
  2727.       fprintf(stderr,"strdup: out of memory?\n"); exit(255);
  2728.      END
  2729.  #endif
  2730. -   if (ptr!=0) strcpy(ptr,s);
  2731. +   if (ptr!=0) custom_string_copy(ptr,s);
  2732.     return ptr;
  2733.  END
  2734.  #endif
  2735. @@ -650,7 +650,7 @@
  2736.  
  2737.  /*--------------------------------------------------------------------------*/
  2738.  
  2739. -/* we need a strcpy() with a defined behaviour in case of overlapping source
  2740. +/* we need a custom_string_copy() with a defined behaviour in case of overlapping source
  2741.     and destination: */
  2742.  
  2743.  char *strmov(char *pDest, const char *pSrc)
  2744. @@ -659,12 +659,11 @@
  2745.    return pDest;
  2746.  }
  2747.  
  2748. -#ifdef __GNUC__
  2749.  
  2750.  #ifdef strcpy
  2751.  # undef strcpy
  2752.  #endif
  2753. -char *strcpy(char *pDest, const char *pSrc)
  2754. +char* custom_string_copy_func(char* pDest, const char* pSrc, const char* file, const int line)
  2755.  {
  2756.    int l = strlen(pSrc) + 1;
  2757.    int Overlap = 0;
  2758. @@ -685,13 +684,12 @@
  2759.    }
  2760.  
  2761.    if (Overlap)
  2762. -    fprintf(stderr, "overlapping strcpy() called from address 0x%p, resolve this address with addr2line and report to author\n",
  2763. -            __builtin_return_address(0));
  2764. +    fprintf(stderr, "overlapping custom_string_copy() called from address 0x%p (%s %d), resolve this address with addr2line and report to author\n",
  2765. +            __builtin_return_address(0), file, line);
  2766.  
  2767.    return strmov(pDest, pSrc);
  2768.  }
  2769.  
  2770. -#endif
  2771.  
  2772.  /*--------------------------------------------------------------------------*/
  2773.  
  2774. diff -uN asl-current/strutil.h asl-newest/strutil.h
  2775. --- asl-current/strutil.h   2010-04-17 10:14:24.000000000 -0300
  2776. +++ asl-newest/strutil.h    2013-12-18 21:08:58.355284819 -0200
  2777. @@ -16,7 +16,7 @@
  2778.  /*****************************************************************************
  2779.   * $Log: strutil.h,v $
  2780.   * Revision 1.7  2010/04/17 13:14:24  alfred
  2781. - * - address overlapping strcpy()
  2782. + * - address overlapping custom_string_copy()
  2783.   *
  2784.   * Revision 1.6  2008/11/23 10:39:17  alfred
  2785.   * - allow strings with NUL characters
  2786. @@ -101,6 +101,10 @@
  2787.    
  2788.  extern void strutil_init(void);
  2789.  
  2790. +#define custom_string_copy(first, second) custom_string_copy_func(first, second, __FILE__, __LINE__)
  2791. +
  2792. +extern char* custom_string_copy_func(char* pDest, const char* pSrc, const char* file, const int line);
  2793. +
  2794.  /* avoid nasty "subscript has type char..." messages on some platforms */
  2795.  
  2796.  #define __chartouint(c) (((unsigned int)(c)) & 0xff)
  2797. diff -uN asl-current/sysdefs.h asl-newest/sysdefs.h
  2798. --- asl-current/sysdefs.h   2012-11-28 18:47:29.000000000 -0200
  2799. +++ asl-newest/sysdefs.h    2013-12-18 21:08:58.355284819 -0200
  2800. @@ -1203,6 +1203,30 @@
  2801.  #endif
  2802.  
  2803.  /*===========================================================================*/
  2804. +/* Apple OSX */
  2805. +
  2806. +#ifdef __APPLE__
  2807. +//#define ARCHPRNAME "apple"
  2808. +#define ARCHSYSNAME "osx"
  2809. +#define DEFSMADE
  2810. +#define OPENRDMODE "r"
  2811. +#define OPENWRMODE "w"
  2812. +#define OPENUPMODE "r+"
  2813. +#define IEEEFLOAT
  2814. +typedef signed char Integ8;
  2815. +typedef unsigned char Card8;
  2816. +typedef signed short Integ16;
  2817. +typedef unsigned short Card16;
  2818. +#define HAS16
  2819. +typedef signed int Integ32;
  2820. +typedef unsigned int Card32;
  2821. +typedef signed long long Integ64;
  2822. +typedef unsigned long long Card64;
  2823. +#define HAS64
  2824. +#define NO_NLS
  2825. +#endif
  2826. +
  2827. +/*===========================================================================*/
  2828.  /* Post-Processing: check for definition, add defaults */
  2829.  
  2830.  
  2831. Common subdirectories: asl-current/tests and asl-newest/tests
  2832. diff -uN asl-current/tex2doc.c asl-newest/tex2doc.c
  2833. --- asl-current/tex2doc.c   2010-12-12 12:31:41.000000000 -0200
  2834. +++ asl-newest/tex2doc.c    2013-12-18 21:08:58.359284819 -0200
  2835. @@ -20,7 +20,7 @@
  2836.   * - use strmov()
  2837.   *
  2838.   * Revision 1.2  2010/08/27 14:52:43  alfred
  2839. - * - some more overlapping strcpy() cleanups
  2840. + * - some more overlapping custom_string_copy() cleanups
  2841.   *
  2842.   * Revision 1.1  2003/11/06 02:49:25  alfred
  2843.   * - recreated
  2844. @@ -266,7 +266,7 @@
  2845.       sprintf(err,"undefined label '%s'",Name);
  2846.       warning(err); DoRepass=True;
  2847.      END
  2848. -   strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
  2849. +   custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
  2850.  END
  2851.  
  2852.     static void GetCite(char *Name, char *Dest)
  2853. @@ -282,7 +282,7 @@
  2854.       sprintf(err,"undefined citation '%s'",Name);
  2855.       warning(err); DoRepass=True;
  2856.      END
  2857. -   strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
  2858. +   custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
  2859.  END
  2860.  
  2861.     static void PrintLabels(char *Name)
  2862. @@ -329,13 +329,13 @@
  2863.  
  2864.    if (!c)
  2865.    {
  2866. -    strcpy(Dest, Src); *Src = '\0';
  2867. +     custom_string_copy(Dest,Src); *Src='\0';
  2868.    }
  2869.    else
  2870.    {
  2871.      *c = '\0'; strcpy(Dest , Src);
  2872.      for (c++; *c == ' '; c++);
  2873. -    strmov(Src, c);
  2874. +     custom_string_copy(Src,c);
  2875.    }
  2876.  }
  2877.  
  2878. @@ -419,7 +419,7 @@
  2879.          BEGIN
  2880.           if ((CurrEnv==EnvDocument) AND (NOT DidPar))
  2881.            BEGIN
  2882. -           strcpy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
  2883. +           custom_string_copy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
  2884.            END
  2885.          END
  2886.         else if (NOT Comment) DidPar=False;
  2887. @@ -437,7 +437,7 @@
  2888.  
  2889.     if (PushedTokenCnt>0)
  2890.      BEGIN
  2891. -     strcpy(Dest,PushedTokens[0].Token); strcpy(SepString,PushedTokens[0].Sep);
  2892. +     custom_string_copy(Dest,PushedTokens[0].Token); custom_string_copy(SepString,PushedTokens[0].Sep);
  2893.       for (z=0; z<PushedTokenCnt-1; z++) PushedTokens[z]=PushedTokens[z+1];
  2894.       PushedTokenCnt--;
  2895.       return True;
  2896. @@ -504,8 +504,8 @@
  2897.     static void BackToken(char *Token)
  2898.  BEGIN
  2899.     if (PushedTokenCnt>=16) return;
  2900. -   strcpy(PushedTokens[PushedTokenCnt].Token,Token);
  2901. -   strcpy(PushedTokens[PushedTokenCnt].Sep,SepString);
  2902. +   custom_string_copy(PushedTokens[PushedTokenCnt].Token,Token);
  2903. +   custom_string_copy(PushedTokens[PushedTokenCnt].Sep,SepString);
  2904.     PushedTokenCnt++;
  2905.  END
  2906.  
  2907. @@ -668,7 +668,7 @@
  2908.         save=(*search); *search='\0';
  2909.         PutLine(True); *search=save;
  2910.         for (; *search==' '; search++);
  2911. -       strcpy(OutLineBuffer,search);
  2912. +       custom_string_copy(OutLineBuffer,search);
  2913.        END
  2914.      END
  2915.  END
  2916. @@ -946,7 +946,7 @@
  2917.      END
  2918.     else
  2919.      BEGIN
  2920. -     if (*OutLineBuffer=='\0') strcpy(OutLineBuffer," ");
  2921. +     if (*OutLineBuffer=='\0') custom_string_copy(OutLineBuffer," ");
  2922.       FlushLine();
  2923.      END
  2924.     if (CurrEnv==EnvTabbing) CurrTabStop=0;
  2925. @@ -1070,7 +1070,7 @@
  2926.     char Line[TOKLEN],Title[TOKLEN],*run;
  2927.     PTocSave NewTocSave,RunToc;
  2928.  
  2929. -   strcpy(Title,OutLineBuffer); *OutLineBuffer='\0';
  2930. +   custom_string_copy(Title,OutLineBuffer); *OutLineBuffer='\0';
  2931.  
  2932.     run=Line;
  2933.     if (Level<3)
  2934. @@ -1098,7 +1098,7 @@
  2935.       NewTocSave->Next=Nil;
  2936.       run=Line; run=GetSectionName(run); run+=sprintf(run," "); sprintf(run,"%s",Title);
  2937.       NewTocSave->TocName=(char *) malloc(6+Level+strlen(Line));
  2938. -     strcpy(NewTocSave->TocName,Blanks(5+Level));
  2939. +     custom_string_copy(NewTocSave->TocName,Blanks(5+Level));
  2940.       strcat(NewTocSave->TocName,Line);
  2941.       if (FirstTocSave==Nil) FirstTocSave=NewTocSave;
  2942.       else
  2943. @@ -1510,7 +1510,7 @@
  2944.     CurrFontType=(TFontType) Index;
  2945.     assert_token("{");
  2946.     ReadToken(NToken);
  2947. -   strcpy(SepString,BackSepString);
  2948. +   custom_string_copy(SepString,BackSepString);
  2949.     BackToken(NToken);
  2950.  END
  2951.  
  2952. @@ -1527,7 +1527,7 @@
  2953.     CurrFontSize=(TFontSize) Index;
  2954.     assert_token("{");
  2955.     ReadToken(NToken);
  2956. -   strcpy(SepString,BackSepString);
  2957. +   custom_string_copy(SepString,BackSepString);
  2958.     BackToken(NToken);
  2959.  END
  2960.  
  2961. @@ -1682,7 +1682,7 @@
  2962.  
  2963.     ReadToken(Token);
  2964.     if (*SepString!='\0') error("invalid control character for \\verb");
  2965. -   Marker=(*Token); strmov(Token,Token+1); strcpy(SepString,BackSepString);
  2966. +   Marker=(*Token); strmov(Token,Token+1); custom_string_copy(SepString,BackSepString);
  2967.     do
  2968.      BEGIN
  2969.       DoAddNormal(SepString,"");
  2970. @@ -1854,7 +1854,7 @@
  2971.     if (Found)
  2972.      BEGIN
  2973.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  2974. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  2975. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  2976.      END
  2977.     else DoAddNormal("\"",BackSepString);
  2978.  
  2979. @@ -1889,7 +1889,7 @@
  2980.     if (Found)
  2981.      BEGIN
  2982.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  2983. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  2984. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  2985.      END
  2986.     else DoAddNormal("\"",BackSepString);
  2987.  
  2988. @@ -1924,7 +1924,7 @@
  2989.     if (Found)
  2990.      BEGIN
  2991.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  2992. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  2993. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  2994.      END
  2995.     else DoAddNormal("\"",BackSepString);
  2996.  
  2997. @@ -1959,7 +1959,7 @@
  2998.     if (Found)
  2999.      BEGIN
  3000.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3001. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3002. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3003.      END
  3004.     else DoAddNormal("\"",BackSepString);
  3005.  
  3006. @@ -1986,7 +1986,7 @@
  3007.     if (Found)
  3008.      BEGIN
  3009.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3010. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3011. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3012.      END
  3013.     else DoAddNormal("\"",BackSepString);
  3014.  
  3015. @@ -1999,8 +1999,8 @@
  3016.     UNUSED(Index);
  3017.  
  3018.     assert_token("{"); collect_token(Token,"}");
  3019. -   if (strcmp(Token,"c")==0) strcpy(Token,CH_ccedil);
  3020. -   if (strcmp(Token,"C")==0) strcpy(Token,CH_Ccedil);
  3021. +   if (strcmp(Token,"c")==0) custom_string_copy(Token,CH_ccedil);
  3022. +   if (strcmp(Token,"C")==0) custom_string_copy(Token,CH_Ccedil);
  3023.  
  3024.     DoAddNormal(Token,BackSepString);
  3025.  END
  3026. @@ -2038,7 +2038,7 @@
  3027.     if (Found)
  3028.      BEGIN
  3029.       if (strlen(Repl)!=cnt) memmove(Line+strlen(Repl),Line+cnt,strlen(Line)-cnt+1);
  3030. -     memcpy(Line,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3031. +     memcpy(Line,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3032.      END
  3033.     else DoAddNormal("\"",BackSepString);
  3034.  
  3035. @@ -2072,7 +2072,7 @@
  3036.  
  3037.     static void TeXDoSpec(void)
  3038.  BEGIN
  3039. -   strcpy(BackSepString,SepString);
  3040. +   custom_string_copy(BackSepString,SepString);
  3041.     TeXNLS(0);
  3042.  END
  3043.  
  3044. @@ -2272,11 +2272,11 @@
  3045.     BibIndent=BibCounter=0;
  3046.     GermanMode=True; SetLang(False);
  3047.  
  3048. -   strcpy(TocName,argv[1]);
  3049. +   custom_string_copy(TocName,argv[1]);
  3050.     if ((p=strrchr(TocName,'.'))!=Nil) *p='\0';
  3051.     strcat(TocName,".dtoc");
  3052.  
  3053. -   strcpy(AuxFile,argv[1]);
  3054. +   custom_string_copy(AuxFile,argv[1]);
  3055.     if ((p=strrchr(AuxFile,'.'))!=Nil) *p='\0';
  3056.     strcat(AuxFile,".daux");
  3057.     ReadAuxFile(AuxFile);
  3058. @@ -2286,7 +2286,7 @@
  3059.       if (NOT ReadToken(Line)) break;
  3060.       if (strcmp(Line,"\\")==0)
  3061.        BEGIN
  3062. -       strcpy(BackSepString,SepString);
  3063. +       custom_string_copy(BackSepString,SepString);
  3064.         if (NOT ReadToken(Line)) error("unexpected end of file");
  3065.         if (*SepString!='\0') BackToken(Line);
  3066.         else if (NOT LookupInstTable(TeXTable,Line))
  3067. @@ -2300,8 +2300,8 @@
  3068.        BEGIN
  3069.         if ((InMathMode=(NOT InMathMode)))
  3070.          BEGIN
  3071. -         strcpy(BackSepString,SepString);
  3072. -         ReadToken(Line); strcpy(SepString,BackSepString);
  3073. +         custom_string_copy(BackSepString,SepString);
  3074. +         ReadToken(Line); custom_string_copy(SepString,BackSepString);
  3075.           BackToken(Line);
  3076.          END
  3077.        END
  3078. diff -uN asl-current/tex2html.c asl-newest/tex2html.c
  3079. --- asl-current/tex2html.c  2010-08-27 11:52:43.000000000 -0300
  3080. +++ asl-newest/tex2html.c   2013-12-18 21:08:58.359284819 -0200
  3081. @@ -23,10 +23,10 @@
  3082.  /*****************************************************************************
  3083.   * $Log: tex2html.c,v $
  3084.   * Revision 1.4  2010/08/27 14:52:43  alfred
  3085. - * - some more overlapping strcpy() cleanups
  3086. + * - some more overlapping custom_string_copy() cleanups
  3087.   *
  3088.   * Revision 1.3  2010/04/17 13:14:24  alfred
  3089. - * - address overlapping strcpy()
  3090. + * - address overlapping custom_string_copy()
  3091.   *
  3092.   * Revision 1.2  2004/11/20 21:32:27  alfred
  3093.   * - adaptions for MinGW
  3094. @@ -275,7 +275,7 @@
  3095.       sprintf(err,"undefined label '%s'",Name);
  3096.       warning(err); DoRepass=True;
  3097.      END
  3098. -   strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
  3099. +   custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
  3100.  END
  3101.  
  3102.     static void GetCite(char *Name, char *Dest)
  3103. @@ -291,7 +291,7 @@
  3104.       sprintf(err,"undefined citation '%s'",Name);
  3105.       warning(err); DoRepass=True;
  3106.      END
  3107. -   strcpy(Dest,(Run==Nil) ? "???" : Run->Value);
  3108. +   custom_string_copy(Dest,(Run==Nil) ? "???" : Run->Value);
  3109.  END
  3110.  
  3111.     static void PrintLabels(char *Name)
  3112. @@ -339,11 +339,11 @@
  3113.  
  3114.     if (c==Nil)
  3115.      BEGIN
  3116. -     strcpy(Dest,Src); *Src='\0';
  3117. +     custom_string_copy(Dest,Src); *Src='\0';
  3118.      END
  3119.     else
  3120.      BEGIN
  3121. -     *c='\0'; strcpy(Dest,Src);
  3122. +     *c='\0'; custom_string_copy(Dest,Src);
  3123.       for (c++; *c==' '; c++);
  3124.       strmov(Src,c);
  3125.      END
  3126. @@ -429,7 +429,7 @@
  3127.          BEGIN
  3128.           if ((CurrEnv==EnvDocument) AND (NOT DidPar))
  3129.            BEGIN
  3130. -           strcpy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
  3131. +           custom_string_copy(BufferLine,"\\par\n"); DidPar=True; Comment=False;
  3132.            END
  3133.          END
  3134.         else if (Comment)
  3135. @@ -454,7 +454,7 @@
  3136.  
  3137.     if (PushedTokenCnt>0)
  3138.      BEGIN
  3139. -     strcpy(Dest,PushedTokens[0].Token); strcpy(SepString,PushedTokens[0].Sep);
  3140. +     custom_string_copy(Dest,PushedTokens[0].Token); custom_string_copy(SepString,PushedTokens[0].Sep);
  3141.       for (z=0; z<PushedTokenCnt-1; z++) PushedTokens[z]=PushedTokens[z+1];
  3142.       PushedTokenCnt--;
  3143.       return True;
  3144. @@ -521,8 +521,8 @@
  3145.     static void BackToken(char *Token)
  3146.  BEGIN
  3147.     if (PushedTokenCnt>=16) return;
  3148. -   strcpy(PushedTokens[PushedTokenCnt].Token,Token);
  3149. -   strcpy(PushedTokens[PushedTokenCnt].Sep,SepString);
  3150. +   custom_string_copy(PushedTokens[PushedTokenCnt].Token,Token);
  3151. +   custom_string_copy(PushedTokens[PushedTokenCnt].Sep,SepString);
  3152.     PushedTokenCnt++;
  3153.  END
  3154.  
  3155. @@ -740,7 +740,7 @@
  3156.  BEGIN
  3157.     char erg[10];
  3158.  
  3159. -   strcpy(erg,"<");
  3160. +   custom_string_copy(erg,"<");
  3161.     if (FontNormalSize==Type) return;
  3162.  
  3163.     if (NOT On) strcat(erg,"/");
  3164. @@ -1023,7 +1023,7 @@
  3165.      END
  3166.     else
  3167.      BEGIN
  3168. -     if (*OutLineBuffer=='\0') strcpy(OutLineBuffer," ");
  3169. +     if (*OutLineBuffer=='\0') custom_string_copy(OutLineBuffer," ");
  3170.       AddLine("<BR>",""); FlushLine();
  3171.      END
  3172.  END
  3173. @@ -1150,7 +1150,7 @@
  3174.     int Level=LastLevel;
  3175.     char Line[TOKLEN],Title[TOKLEN],Ref[TOKLEN],*run,*rep;
  3176.  
  3177. -   strcpy(Title,OutLineBuffer); *OutLineBuffer='\0';
  3178. +   custom_string_copy(Title,OutLineBuffer); *OutLineBuffer='\0';
  3179.  
  3180.     fprintf(outfile, "<H%d>", Level + 1);
  3181.  
  3182. @@ -1648,7 +1648,7 @@
  3183.     TeXNewFontType(Index);
  3184.     assert_token("{");
  3185.     ReadToken(NToken);
  3186. -   strcpy(SepString,BackSepString);
  3187. +   custom_string_copy(SepString,BackSepString);
  3188.     BackToken(NToken);
  3189.  END
  3190.  
  3191. @@ -1665,7 +1665,7 @@
  3192.     TeXNewFontSize(Index);
  3193.     assert_token("{");
  3194.     ReadToken(NToken);
  3195. -   strcpy(SepString,BackSepString);
  3196. +   custom_string_copy(SepString,BackSepString);
  3197.     BackToken(NToken);
  3198.  END
  3199.  
  3200. @@ -1839,7 +1839,7 @@
  3201.  
  3202.     ReadToken(Token);
  3203.     if (*SepString!='\0') error("invalid control character for \\verb");
  3204. -   Marker=(*Token); strmov(Token,Token+1); strcpy(SepString,BackSepString);
  3205. +   Marker=(*Token); strmov(Token,Token+1); custom_string_copy(SepString,BackSepString);
  3206.     do
  3207.      BEGIN
  3208.       DoAddNormal(SepString,"");
  3209. @@ -1970,11 +1970,11 @@
  3210.        BEGIN
  3211.         if (strncmp(Line,BiblioName,strlen(BiblioName))==0)
  3212.          BEGIN
  3213. -         strcpy(Ref,"bib"); Level=1;
  3214. +         custom_string_copy(Ref,"bib"); Level=1;
  3215.          END
  3216.         else if (strncmp(Line,IndexName,strlen(IndexName))==0)
  3217.          BEGIN
  3218. -         strcpy(Ref,"index"); Level=1;
  3219. +         custom_string_copy(Ref,"index"); Level=1;
  3220.          END
  3221.         else
  3222.          BEGIN
  3223. @@ -2079,7 +2079,7 @@
  3224.     if (Found)
  3225.      BEGIN
  3226.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3227. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3228. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3229.      END
  3230.     else DoAddNormal("\"",BackSepString);
  3231.  
  3232. @@ -2114,7 +2114,7 @@
  3233.     if (Found)
  3234.      BEGIN
  3235.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3236. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3237. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3238.      END
  3239.     else DoAddNormal("\"",BackSepString);
  3240.  
  3241. @@ -2149,7 +2149,7 @@
  3242.     if (Found)
  3243.      BEGIN
  3244.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3245. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3246. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3247.      END
  3248.     else DoAddNormal("\"",BackSepString);
  3249.  
  3250. @@ -2184,7 +2184,7 @@
  3251.     if (Found)
  3252.      BEGIN
  3253.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3254. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3255. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3256.      END
  3257.     else DoAddNormal("\"",BackSepString);
  3258.  
  3259. @@ -2211,7 +2211,7 @@
  3260.     if (Found)
  3261.      BEGIN
  3262.       if (strlen(Repl)>1) memmove(Token+strlen(Repl),Token+1,strlen(Token));
  3263. -     memcpy(Token,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3264. +     memcpy(Token,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3265.      END
  3266.     else DoAddNormal("\"",BackSepString);
  3267.  
  3268. @@ -2224,8 +2224,8 @@
  3269.     UNUSED(Index);
  3270.  
  3271.     assert_token("{"); collect_token(Token,"}");
  3272. -   if (strcmp(Token,"c")==0) strcpy(Token,"&ccedil;");
  3273. -   if (strcmp(Token,"C")==0) strcpy(Token,"&Ccedil;");
  3274. +   if (strcmp(Token,"c")==0) custom_string_copy(Token,"&ccedil;");
  3275. +   if (strcmp(Token,"C")==0) custom_string_copy(Token,"&Ccedil;");
  3276.  
  3277.     DoAddNormal(Token,BackSepString);
  3278.  END
  3279. @@ -2263,7 +2263,7 @@
  3280.     if (Found)
  3281.      BEGIN
  3282.       if (strlen(Repl)!=cnt) memmove(Line+strlen(Repl),Line+cnt,strlen(Line)-cnt+1);
  3283. -     memcpy(Line,Repl,strlen(Repl)); strcpy(SepString,BackSepString);
  3284. +     memcpy(Line,Repl,strlen(Repl)); custom_string_copy(SepString,BackSepString);
  3285.      END
  3286.     else DoAddNormal("\"",BackSepString);
  3287.  
  3288. @@ -2295,7 +2295,7 @@
  3289.       SaveFont();
  3290.       TeXNewFontType(FontSuper);
  3291.       ReadToken(Token);
  3292. -     strcpy(SepString,BackSepString);
  3293. +     custom_string_copy(SepString,BackSepString);
  3294.       BackToken(Token);
  3295.      END
  3296.     else
  3297. @@ -2307,7 +2307,7 @@
  3298.  
  3299.     static void TeXDoSpec(void)
  3300.  BEGIN
  3301. -   strcpy(BackSepString,SepString);
  3302. +   custom_string_copy(BackSepString,SepString);
  3303.     TeXNLS(0);
  3304.  END
  3305.  
  3306. @@ -2561,11 +2561,11 @@
  3307.  
  3308.     /* open help files */
  3309.  
  3310. -   strcpy(TocName,argv[1]);
  3311. +   custom_string_copy(TocName,argv[1]);
  3312.     if ((p=strrchr(TocName,'.'))!=Nil) *p='\0';
  3313.     strcat(TocName,".htoc");
  3314.  
  3315. -   strcpy(AuxFile,argv[1]);
  3316. +   custom_string_copy(AuxFile,argv[1]);
  3317.     if ((p=strrchr(AuxFile,'.'))!=Nil) *p='\0';
  3318.     strcat(AuxFile,".haux");
  3319.     ReadAuxFile(AuxFile);
  3320. @@ -2611,7 +2611,7 @@
  3321.       if (NOT ReadToken(Line)) break;
  3322.       if (strcmp(Line,"\\")==0)
  3323.        BEGIN
  3324. -       strcpy(BackSepString,SepString);
  3325. +       custom_string_copy(BackSepString,SepString);
  3326.         if (NOT ReadToken(Line)) error("unexpected end of file");
  3327.         if (*SepString!='\0') BackToken(Line);
  3328.         else if (NOT LookupInstTable(TeXTable,Line))
  3329. @@ -2625,8 +2625,8 @@
  3330.        BEGIN
  3331.         if ((InMathMode=(NOT InMathMode)))
  3332.          BEGIN
  3333. -         strcpy(BackSepString,SepString);
  3334. -         ReadToken(Line); strcpy(SepString,BackSepString);
  3335. +         custom_string_copy(BackSepString,SepString);
  3336. +         ReadToken(Line); custom_string_copy(SepString,BackSepString);
  3337.           BackToken(Line);
  3338.          END
  3339.        END
RAW Paste Data