Re: Error 128 - Line too long during get


Anders
 

// a2rmb.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdio.h" #include "string.h" FILE *infile; FILE *outfile; char buffer[1000]; char temp[10]; int rc; int length; unsigned char hi, lo; int _tmain(int argc, char* argv[]) { rc= fopen_s(&infile,argv[1],"r"); if(rc != 0) { printf("Invalid infile name %s", argv[1]); return 0; } rc = fopen_s(&outfile,argv[2],"wc"); if(rc != 0) { printf("Invalid outfile name %s", argv[2]); return 0; } // memset(buffer,0,500); while(fgets(buffer,500,infile)!=NULL) { //fprintf(outfile,"%s",buffer); length = strlen(buffer); if(buffer[length-1] == 0x0d) { buffer[length-1] = 0; --length; } if(buffer[length-1] == 0x0a) { buffer[length-1] = 0; --length; } hi = length/256; lo = length % 256; fwrite(&hi,1,1,outfile); fwrite(&lo,1,1,outfile); fwrite(buffer,1,length, outfile); } fclose(infile); fclose(outfile); return 0; }

No idea why this will nt post correctly though..

Join VintHPcom@groups.io to automatically receive all group messages.