
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

#include"sitar_scan.h"
#include<almemsys/almemsys.h>


// int count_memcpy3(char out[], char * data, int start, int plus);


int count_memcpy3(char out[], char * data, int start, int plus)
{
int stop, max, count, co;
max = (int)strlen(data);

if(start < 0 || plus < 0 || max < 0){
   out[0] = (char)0x00;
   return -1;
   }

stop = start + plus;

if(max < stop){
   out[0] = (char)0x00;
   return -1;
   }

co = 0;
for(count = start; count <= stop; count ++){
   out[co] = data[count];
   co++;
   }

out[co] = (char)0x00;

return co;
}


