Search:

Type: Posts; User: Mitch

Search: Search took 0.00 seconds.

  1. Replies
    16
    Views
    2,562

    OK here's the actual code, I did simplify it a...

    OK here's the actual code, I did simplify it a bit initially, but I think this may help if I paste the code proper. (There's a few things I've tried and failed that are commented out)


    #define...
  2. Replies
    16
    Views
    2,562

    hence my asking here ;) i just cant figure it...

    hence my asking here ;)

    i just cant figure it out.
    I've just replaced the
    chunk.memory=&chunk.memory[1];
    line with a new one using memmove, still got it.

    EDIT:
    I read something somewhere...
  3. Replies
    16
    Views
    2,562

    but then that defeats the whole point of using...

    but then that defeats the whole point of using strncpy: to remove the last 773 chars from the string.

    EDIT:
    I just tried commenting out that whole section of code and it made no difference - I...
  4. Replies
    16
    Views
    2,562

    I've just tried assigning and writing tempstr1...

    I've just tried assigning and writing tempstr1 with malloc() and the appropriate size and i still get the error.
  5. Replies
    16
    Views
    2,562

    it's 448 chars. if it was overflowing, why would...

    it's 448 chars. if it was overflowing, why would printf still print all the data upto the end?
    + that's not the point where i get the segfault. the error occurs after all that code and i try to...
  6. Replies
    16
    Views
    2,562

    chunk.memory is allocated as in my previous post...

    chunk.memory is allocated as in my previous post and tmpstr1 is declared as

    char tmpstr1[2048];
    the sample data I'm using is only a few hundred chars.
  7. Replies
    16
    Views
    2,562

    The data is created with these functions: ...

    The data is created with these functions:

    void *myrealloc(void *ptr, size_t size)
    {
    // There might be a realloc() out there that doesn't like reallocing NULL pointers, so we take care of it...
  8. Replies
    16
    Views
    2,562

    Problem with pointers/strings/memory

    I've been pouring over this for over a day now and still have no solution, so hopefully I'll get one here :D

    I have a struct

    struct MemoryStruct {
    char *memory;
    size_t size;
    }; which...
Results 1 to 8 of 9