
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<unistd.h>
#include<sys/socket.h>
#include<sys/wait.h>
#include<string.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<pthread.h>

#include"zither.h"
#include<almemsys/almemsys.h>
#include"jpreturn.h"



char * check_strtol(char * data)
{
int count, count0;
int cmax = (int)strlen(data);

char * swap = (char *)calloc((cmax + 60), sizeof(char));

count0 = 0;
for(count = 0; count < cmax; count++){
   switch(data[count]){
      case ',' :
                 if(data[count - 1] == ','){
                    swap[count0] = 'N';
                    count0++;
                    swap[count0] = 'O';
                    count0++;
                    swap[count0] = 'T';
                    count0++;
                    swap[count0] = ',';
                    }
                 else{
                    swap[count0] = data[count];
                    }
                 break;
      default  :
                 swap[count0] = data[count];
                 break;
      }
   count0++;
   }

swap[count0] = (char)0x00;
data = safe_memcpy(data, swap, BUF_MAX);

free(swap);

return data;
}



