Commit cdefa544 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

bugs on MemoryBuffers

parent b63f2205
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ CC = gcc
CXX      = g++
CXX      = g++
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
#Insert the optional parameter to the compiler. The CFLAGS could be changed externally by the user
#- g3
#- g3
CFLAGS   =  -O2 -O0 -m64 -fPIC
CFLAGS   =  -O2 -O0 -m64 -fPIC -g
#-O2 -O0 -g3
#-O2 -O0 -g3
#Set INCPATH to add the inclusion paths
#Set INCPATH to add the inclusion paths
INCPATH = -I ./include
INCPATH = -I ./include
+6 −0
Original line number Original line Diff line number Diff line
@@ -41,6 +41,8 @@ public:
    /// Read property of char** buffer.
    /// Read property of char** buffer.
    char* getbuffer();
    char* getbuffer();


    bool getEOF();

    char* getlastbuffer();
    char* getlastbuffer();


    char* getbuffer(dword index);
    char* getbuffer(dword index);
@@ -72,6 +74,8 @@ public:


    long setpos(int index);
    long setpos(int index);


    void printBuffer();

private:
private:


    int bookmarkpos;
    int bookmarkpos;
@@ -87,6 +91,8 @@ private:
    char* currentpwd;
    char* currentpwd;


    char* bufferName;
    char* bufferName;

    bool eof;
};
};


}
}
+8849 −1603

File changed.

Preview size limit exceeded, changes collapsed.

+2 −0
Original line number Original line Diff line number Diff line
@@ -60,6 +60,8 @@ char* ConfigurationFile::getLine() throw(PacketExceptionIO*)
    try
    try
    {
    {
        temp = InputTextFile::getLine();
        temp = InputTextFile::getLine();
        if(temp[0] == 0)
        	return temp;
        while(strstr(temp, "--") !=  NULL)
        while(strstr(temp, "--") !=  NULL)
        {
        {
            //delete[] temp;
            //delete[] temp;
+3 −6
Original line number Original line Diff line number Diff line
@@ -184,16 +184,13 @@ char* File::getLine() throw(PacketExceptionIO*)
    }
    }
    s[i] = '\0';
    s[i] = '\0';
    unsigned dims = strlen(s);
    unsigned dims = strlen(s);
    char* sr = new char[ dims + 1];
    //char* sr = new char[ dims + 1];
    for(unsigned i=0; i<=dims; i++)
        sr[i] = s[i];

    delete[] lastLineRead;
    delete[] lastLineRead;
    lastLineRead = new char[ dims + 1];
    lastLineRead = new char[ dims + 1];
    for(unsigned i=0; i<=dims; i++)
    for(unsigned i=0; i<=dims; i++)
    	lastLineRead[i]  = s[i];
    	lastLineRead[i]  = s[i];


    return sr;
    return lastLineRead;
}
}




Loading