root/src/strcpy1.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. strcpy1

   1 /*     CalculiX - A 3-dimensional finite element program                 */
   2 /*              Copyright (C) 1998-2015 Guido Dhondt                          */
   3 
   4 /*     This program is free software; you can redistribute it and/or     */
   5 /*     modify it under the terms of the GNU General Public License as    */
   6 /*     published by the Free Software Foundation(version 2);    */
   7 /*                                                                       */
   8 
   9 /*     This program is distributed in the hope that it will be useful,   */
  10 /*     but WITHOUT ANY WARRANTY; without even the implied warranty of    */ 
  11 /*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      */
  12 /*     GNU General Public License for more details.                      */
  13 
  14 /*     You should have received a copy of the GNU General Public License */
  15 /*     along with this program; if not, write to the Free Software       */
  16 /*     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.         */
  17 
  18 #include <stdlib.h>
  19 #include <math.h>
  20 #include <stdio.h>
  21 #include <string.h>
  22 #include "CalculiX.h"
  23 
  24 ITG strcpy1(char *s1, const char *s2, ITG length)
  25 {
  26   ITG b,i,blank=0;
  27 
  28   for(i=0;i<length;i++) {
  29       if(blank==0){
  30           b=*s2;
  31           if(b=='\0')blank=1;
  32       }
  33       if(blank==0) {*s1=*s2;s2++;}
  34       else *s1=' ';
  35       s1++;
  36   }
  37   return 0;
  38 }
  39           
  40 
  41 
  42 
  43 

/* [<][>][^][v][top][bottom][index][help] */