Search:

Type: Posts; User: anduril462

Search: Search took 0.08 seconds.

  1. Replies
    15
    Views
    3,778

    Hmm...try valgrind --tool=memcheck...

    Hmm...try

    valgrind --tool=memcheck --leak-check=yes ./prosqueeze
    with the dot-slash, it may be a path issue.
  2. Replies
    15
    Views
    3,778

    temp = malloc(MAXLINE * sizeof(char)); Where do...

    temp = malloc(MAXLINE * sizeof(char));
    Where do you free temp? I already told you to look into tools like valgrind (see post #8, near the bottom).
  3. Replies
    15
    Views
    3,778

    Now you've introduced a different buffer...

    Now you've introduced a different buffer overflow. If the user says they want to enter 26 letters, and they put commas in between each one, fgets wont read them all because 26 letters + 25 commas is...
  4. Replies
    15
    Views
    3,778

    Don't just read the prototype. Try reading the...

    Don't just read the prototype. Try reading the whole man page (or at least all the relevant parts).

    The man pages for any C function will have a "RETURN VALUE" section, describing the value...
  5. Replies
    15
    Views
    3,778

    Since you didn't provide the new version of your...

    Since you didn't provide the new version of your code, I must assume you only made the changes you mention in the above post.


    This is still not a fix. All it amounts to is a broken...
  6. Replies
    15
    Views
    3,778

    I don't really know what you mean by "need of...

    I don't really know what you mean by "need of malloc". You do not need malloc for this program, and you're using it incorrectly.


    s = malloc(MAXLINE * sizeof(char*));
    t = malloc(ALPHA *...
  7. Replies
    15
    Views
    3,778

    This is a very common problem when mixing line...

    This is a very common problem when mixing line input (fgets), formatted input (scanf) and character input (getchar/fgetc). After you input 4, you press enter, which puts a '\n' (new line) in the...
Results 1 to 7 of 7