Skip to main content
edited title
Link
fwoosh
  • 201
  • 1
  • 17

crack.c: UndefinedBehaviorSanitizer:DEADLYSIGNAL --SOLVED--

Rollback to Revision 1
Source Link
fwoosh
  • 201
  • 1
  • 17

crack.c: No response 😒UndefinedBehaviorSanitizer:DEADLYSIGNAL

When I run my crack.c, the program never responds. It just sits there and wastes time. I even tried debugging it on the CS50 IDE, and it was normal. Here is my code:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);
string deleteAll(string s, char target);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(65),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(65);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = (int) strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0,
        c5 = 0;
    // These things check if each loop is done.
    bool done = false,
         done1 = false,
         done2 = false,
         done3 = false,
         done4 = false,
         done5 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    while (!done5)
// Sets temp to the current pw (the loops guess in the following order: a, b, c, d, e..., Z, {
aa, ab, ac...zz, Aa, ...).
                    temp[0] = characters[c1];   // Sets temp to characters[c1] characters[c2] etc.
                        temp[1] = characters[c2];
                        temp[2] = characters[c3];
                        temp[3] = characters[c4];
                        temp[4] = characters[c5];
                        temp[5] = '\0';
                        if (temp == NULL)   // Prevents segmentation errors.
                        {
                           = printfdeleteAll("Segmentation errortemp, found.\nEnding' Program"');
                            done = true;
                        }
                // Checks if the pw is the correct one.
                        else if (strcmp(crypt(temp, salt), hashed) == 0)    // Checks if it is done.
                        {
                            out = temp;
                            done = true;
                        }
                        else if (c5 > strlen(characters) - 1)   // Checks when to exit THIS loop
                        {
                            done5 = true;
                        }
                        c5++;
                    }
                    if (done)   // Increments c4 and sets c5 to 0.
                    {
                        break;
                    }
                    else if (c4 > strlen(characters) - 1)     // Checks when to exit THIS loop
                    {
                        out = temp;    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    elseif ((c1 == length - 1) &  // Sees if it should stop.
                        (c2 == length - 1) &
                        (c3 == length - 1) &
                        (c4 == length - 1))
                    {
                        c5out = 0;"Unknown hash";    // Sets out to temp, and exits the loops
                        c4++;done1 = true;
                        done5done2 = false;true;
                        done3 = true;
                        done4 = true;
                    }
                }
                if (done)   // Increments c3 and sets c4 to 0.
                {
                    break;
                }
                else if (c3 > strlen(characters) - 1) // Checks when to exit THIS loop
                {
                    done3 = true;
                }
                else
                {
                    c4 = 0;
                    c3++;
                    done4 = false;c4++;
                }
            }
            if (done)   // Increments c2 and sets c3 to 0.
            {
                break;
            }
            else if (c2 > strlen(characters) - 1) // Checks when to exit THIS loop
            {
                done2 = true;
            }
            else
            {
                c3 = 0;
                c2++;
                done3 = false;c3++;
            }
        }
        if (done)   // Increments c1 and sets c2 to 0.
        {
            break;
        }
        else if (c1 > strlen(characters) - 1) // Checks when to exit THIS loop
        {
            done1 = true;
        }
        else
        {
            c2 = 0;
            c1++;
            done2 = false;c2++;
        }
        c1++;
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

Is my computer slowIt always gives me this error:

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==1368==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000439000 (pc 0x00000042
89c7 bp 0x7ffc6391da50 sp 0x7ffc6391d750 T1368)
==1368==The signal is caused by a READ memory access.
    #0 0x4289c6 in crack /root/sandbox/crack.c:65:31
    #1 0x42809e in main /root/sandbox/crack.c:21:21
    #2 0x7f346c551b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.
c:310
    #3 0x402b89 in _start (/root/sandbox/crack+0x402b89)

UndefinedBehaviorSanitizer can not provide additional info.
==1368==ABORTING

Can someone tell me (because it sometimes isor at least help me with) or does the program have problemswhat this error means? Everytime I run it, it skips right over the hash. (You can see the code here, but please don't do anything bad. I WILL SEE IT)

crack.c: No response 😒

When I run my crack.c, the program never responds. It just sits there and wastes time. I even tried debugging it on the CS50 IDE, and it was normal. Here is my code:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(6),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(6);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0,
        c5 = 0;
    // These things check if each loop is done.
    bool done = false,
         done1 = false,
         done2 = false,
         done3 = false,
         done4 = false,
         done5 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    while (!done5)
                    {
                        temp[0] = characters[c1];   // Sets temp to characters[c1] characters[c2] etc.
                        temp[1] = characters[c2];
                        temp[2] = characters[c3];
                        temp[3] = characters[c4];
                        temp[4] = characters[c5];
                        temp[5] = '\0';
                        if (temp == NULL)   // Prevents segmentation errors.
                        {
                            printf("Segmentation error found.\nEnding Program");
                            done = true;
                        }
                        
                        else if (strcmp(crypt(temp, salt), hashed) == 0)    // Checks if it is done.
                        {
                            out = temp;
                            done = true;
                        }
                        else if (c5 > strlen(characters) - 1)   // Checks when to exit THIS loop
                        {
                            done5 = true;
                        }
                        c5++;
                    }
                    if (done)   // Increments c4 and sets c5 to 0.
                    {
                        break;
                    }
                    else if (c4 > strlen(characters) - 1)     // Checks when to exit THIS loop
                    {
                        done4 = true;
                    }
                    else
                    {
                        c5 = 0;
                        c4++;
                        done5 = false;
                    }
                }
                if (done)   // Increments c3 and sets c4 to 0.
                {
                    break;
                }
                else if (c3 > strlen(characters) - 1) // Checks when to exit THIS loop
                {
                    done3 = true;
                }
                else
                {
                    c4 = 0;
                    c3++;
                    done4 = false;
                }
            }
            if (done)   // Increments c2 and sets c3 to 0.
            {
                break;
            }
            else if (c2 > strlen(characters) - 1) // Checks when to exit THIS loop
            {
                done2 = true;
            }
            else
            {
                c3 = 0;
                c2++;
                done3 = false;
            }
        }
        if (done)   // Increments c1 and sets c2 to 0.
        {
            break;
        }
        else if (c1 > strlen(characters) - 1) // Checks when to exit THIS loop
        {
            done1 = true;
        }
        else
        {
            c2 = 0;
            c1++;
            done2 = false;
        }
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

Is my computer slow (because it sometimes is) or does the program have problems? Everytime I run it, it skips right over the hash. (You can see the code here, but please don't do anything bad. I WILL SEE IT)

crack.c: UndefinedBehaviorSanitizer:DEADLYSIGNAL

When I run my code:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);
string deleteAll(string s, char target);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(5),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(5);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = (int) strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0;
    // These things check if each loop is done.
    bool done1 = false,
         done2 = false,
         done3 = false,
         done4 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    // Sets temp to the current pw (the loops guess in the following order: a, b, c, d, e..., Z, aa, ab, ac...zz, Aa, ...).
                    temp[0] = characters[c1];
                    temp[1] = characters[c2];
                    temp[2] = characters[c3];
                    temp[3] = characters[c4];
                    temp[4] = '\0';
                    temp = deleteAll(temp, ' ');
                    // Checks if the pw is the correct one.
                    if (strcmp(crypt(temp, salt), hashed) == 0)
                    {
                        out = temp;    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    if ((c1 == length - 1) &  // Sees if it should stop.
                        (c2 == length - 1) &
                        (c3 == length - 1) &
                        (c4 == length - 1))
                    {
                        out = "Unknown hash";    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    c4++;
                }
                c3++;
            }
            c2++;
        }
        c1++;
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

It always gives me this error:

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==1368==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000439000 (pc 0x00000042
89c7 bp 0x7ffc6391da50 sp 0x7ffc6391d750 T1368)
==1368==The signal is caused by a READ memory access.
    #0 0x4289c6 in crack /root/sandbox/crack.c:65:31
    #1 0x42809e in main /root/sandbox/crack.c:21:21
    #2 0x7f346c551b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.
c:310
    #3 0x402b89 in _start (/root/sandbox/crack+0x402b89)

UndefinedBehaviorSanitizer can not provide additional info.
==1368==ABORTING

Can someone tell me (or at least help me with) what this error means?

deleted 9864 characters in body; edited tags; edited title
Source Link
fwoosh
  • 201
  • 1
  • 17

crack.c: UndefinedBehaviorSanitizer:DEADLYSIGNALNo response 😒

When I run my code:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);
string deleteAll(string s, char target);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(5),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(5);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = (int) strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0;
    // These things check if each loop is done.
    bool done1 = false,
         done2 = false,
         done3 = false,
         done4 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    // Sets temp to the current pw (the loops guess in the following order: a, b, c, d, e..., Z, aa, ab, ac...zz, Aa, ...).
                    temp[0] = characters[c1];
                    temp[1] = characters[c2];
                    temp[2] = characters[c3];
                    temp[3] = characters[c4];
                    temp[4] = '\0';
                    temp = deleteAll(temp, ' ');
                    // Checks if the pw is the correct one.
                    if (strcmp(crypt(temp, salt), hashed) == 0)
                    {
                        out = temp;    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    if ((c1 == length - 1) &  // Sees if it should stop.
                        (c2 == length - 1) &
                        (c3 == length - 1) &
                        (c4 == length - 1))
                    {
                        out = "Unknown hash";    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    c4++;
                }
                c3++;
            }
            c2++;
        }
        c1++;
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

crack.c, the program never responds. It always gives me this errorjust sits there and wastes time. I even tried debugging it on the CS50 IDE, and it was normal. Here is my code:

UndefinedBehaviorSanitizer:DEADLYSIGNAL#include <cs50.h>
==1368==ERROR:#include UndefinedBehaviorSanitizer:<stdio.h>
#include SEGV<crypt.h>
#include on<string.h>

string unknowncrack(string addresshashed);

// 0x000000439000Deals with input and stuff and feeds info into functions.
int main(pcint 0x00000042argc, string argv[])
89c7{
 bp 0x7ffc6391da50 sp 0x7ffc6391d750// T1368Returns 1 because this is an error (because there is no hashed pw).
==1368==The signal is caused byif a(argc READ!= memory2)
 access   {
        printf("Usage: ./crack hash\n");
    #0 0x4289c6 in  return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/rootchecking.
        string pw = crack(argv[1]);
        /sandbox/ Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; .c:65:31..
    #1string 0x42809echaracters in= main" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           /root/sandbox A temporary variable that is useful for guessing.
           temp = malloc(6),
           /crack/ The salt for crypt() (salt will be defined in next two lines).c:21:21
    #2 0x7f346c551b96      salt = malloc(3),
           // The output.
           out = malloc(6);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in __libc_start_mainthe for loops in the next lines.
    int length = strlen(characters),
        c1 = 0,    /build/glibc c1-OTsEL54 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0,
        c5 = 0;
    /glibc-2/ These things check if each loop is done.27
    bool done = false,
         done1 = false,
         done2 = false,
         done3 = false,
         done4 = false,
         done5 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    while (!done5)
                    {
                        temp[0] = characters[c1];   /csu/ Sets temp to characters[c1] characters[c2] etc.
                        temp[1] = characters[c2];
                        temp[2] = characters[c3];
                        temp[3] = characters[c4];
                        temp[4] = characters[c5];
                        temp[5] = '\0';
                        if (temp == NULL)   // Prevents segmentation errors.
                        {
                            printf("Segmentation error found.\nEnding Program");
                            done = true;
                        }
                        
                        else if (strcmp(crypt(temp, salt), hashed) == 0)    /csu/libc Checks if it is done.
                        {
                            out = temp;
                            done = true;
                        }
                        else if (c5 > strlen(characters) -start 1)   // Checks when to exit THIS loop
                        {
                            done5 = true;
                        }
                        c5++;
                    }
                    if (done)   // Increments c4 and sets c5 to 0.
c:310                    {
    #3 0x402b89 in _start                 break;
                    }
                    else if (c4 > strlen(characters) - 1)     /root/sandbox Checks when to exit THIS loop
                    {
                        done4 = true;
                    }
                    else
                    {
                        c5 = 0;
                        c4++;
                        done5 = false;
                    }
                }
                if (done)   /crack+0x402b89/ Increments c3 and sets c4 to 0.
                {
                    break;
                }
                else if (c3 > strlen(characters) - 1) // Checks when to exit THIS loop
                {
UndefinedBehaviorSanitizer can not provide additional info               done3 = true;
                }
                else
                {
                    c4 = 0;
                    c3++;
                    done4 = false;
                }
            }
            if (done)   // Increments c2 and sets c3 to 0.
==1368==ABORTING            {
                break;
            }
            else if (c2 > strlen(characters) - 1) // Checks when to exit THIS loop
            {
                done2 = true;
            }
            else
            {
                c3 = 0;
                c2++;
                done3 = false;
            }
        }
        if (done)   // Increments c1 and sets c2 to 0.
        {
            break;
        }
        else if (c1 > strlen(characters) - 1) // Checks when to exit THIS loop
        {
            done1 = true;
        }
        else
        {
            c2 = 0;
            c1++;
            done2 = false;
        }
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

Can someone tell me (or at least help me with) what this error means?

----UPDATE----

NEW CODE:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);
string deleteAll(string s, char target);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        if (strcmp(pw, "???") == 0)    // Signals an error (password not found).
        {
            return 2;
        }
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(6),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(6);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = (int) strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0,
        c5 = 0;
    // These things check if each loop is done.
    bool done1 = false,
         done2 = false,
         done3 = false,
         done4 = false,
         done5 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    while (!done5)
                    {
                        // Sets temp to the current pw (the loops guess in the following order: a, b, c, d, e..., Z, aa, ab, ac...zz, Aa, ...).
                        temp[0] = characters[c1];
                        temp[1] = characters[c2];
                        temp[2] = characters[c3];
                        temp[3] = characters[c4];
                        temp[4] = characters[c5];
                        temp[5] = '\0';
                        printf("%s\n", temp);
                        temp = deleteAll(temp, ' ');
                        // Checks if the pw is the correct one.
                        if (strcmp(crypt(temp, salt), hashed) == 0)
                        {
                            out = temp;    // Sets out to temp, and exits the loops
                            done1 = true;
                            done2 = true;
                            done3 = true;
                            done4 = true;
                            done5 = true;
                        }
                        if ((c1 == length - 1) &  // Sees if it should stop.
                            (c2 == length - 1) &
                            (c3 == length - 1) &
                            (c4 == length - 1))
                        {
                            out = "???";    // Sets out to ???, and exits the loops
                            done1 = true;
                            done2 = true;
                            done3 = true;
                            done4 = true;
                            done5 = true;
                        }
                        c5++;
                    }
                    c4++;
                }
                c3++;
            }
            c2++;
        }
        c1++;
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

And output:

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    
    /
    u
    s
    r
    /
    i
    n
    c
    l
    u
    d
    e
    /
    c
    r
    y
    p
    t
    .
    h
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    D
    

    
    j
    

    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    B
    
    
    F
    

    v
    

    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    

    F
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    H
    

    
    x
    0
    A
    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    
    $
    
    
    
    ,
    
    
    
    |
    d
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    A
    

    L
    
    
    
    P
    O
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    I
    

    
    
    
    E
    

    w
    
    (
    T
    
    0
    E
    
    8
    E
    
    @
    U
    
     
    
    `
    
    
    
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    D
    

    s
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    K
    

    `
    
    
    

    
    8
    D
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    O
    

    S
    

    
    8
    D
    
    P
    
    P
    u
    

    
     
    A
    
    
    A
    
    
    B
    
    
    F
    

    
    
    4
    
    
    
    8
    H
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    
    
    
    
    
    
    
    <
    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    
    Y
    

    
    (
    A
    
     
    B
    
    
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    K
    

    y
    

    
    0
    C
    
    (
    A
    
    
    B
    
    
    G
    

    n
    

    
    
    A
    
    
    B
    
    
    G
    

    W
    

    
    
    A
    
    
    B
    
    
    F
    
    K
    

    
    
    A
    
    
    B
    
    
    L
    

    
    N
    

    
    
    A
    
    
    B
    
    
    O
    
    G
    
    0
    
    s
    

    
    (
    A
    
     
    A
    
    
    B
    
    
    B
    
    
    G
    

    
    H
    
    @
    d
    
    H
    a
    
    P
    _
    
    H
    A
    
    @
    
    P
    

    
    (
    A
    
     
    A
    
    
    B
    
    
    B
    
    
    G
    

    
    
    A
    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    T
    
    
    
    8
    S
    
    
    
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    C
    

    
    
    
    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==1507==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000439000 (pc 0x000000428c1b bp 0x7fffd025c290 sp 0x7fffd025bf10 T1507)
==1507==The signal is caused by a READ memory access.
    #0 0x428c1a in crack /root/sandbox/crack.c:74:35
    #1 0x42809e in main /root/sandbox/crack.c:21:21
    #2 0x7ff8d403eb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #3 0x402b89 in _start (/root/sandbox/crack+0x402b89)

UndefinedBehaviorSanitizer can not provide additional info.
==1507==ABORTING

Is my computer slow (because it sometimes is) or does the program have problems? Everytime I run it, it skips right over the hash. (You can see the code here, but please don't do anything bad. I WILL SEE IT)

crack.c: UndefinedBehaviorSanitizer:DEADLYSIGNAL

When I run my code:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);
string deleteAll(string s, char target);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(5),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(5);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = (int) strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0;
    // These things check if each loop is done.
    bool done1 = false,
         done2 = false,
         done3 = false,
         done4 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    // Sets temp to the current pw (the loops guess in the following order: a, b, c, d, e..., Z, aa, ab, ac...zz, Aa, ...).
                    temp[0] = characters[c1];
                    temp[1] = characters[c2];
                    temp[2] = characters[c3];
                    temp[3] = characters[c4];
                    temp[4] = '\0';
                    temp = deleteAll(temp, ' ');
                    // Checks if the pw is the correct one.
                    if (strcmp(crypt(temp, salt), hashed) == 0)
                    {
                        out = temp;    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    if ((c1 == length - 1) &  // Sees if it should stop.
                        (c2 == length - 1) &
                        (c3 == length - 1) &
                        (c4 == length - 1))
                    {
                        out = "Unknown hash";    // Sets out to temp, and exits the loops
                        done1 = true;
                        done2 = true;
                        done3 = true;
                        done4 = true;
                    }
                    c4++;
                }
                c3++;
            }
            c2++;
        }
        c1++;
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

It always gives me this error:

UndefinedBehaviorSanitizer:DEADLYSIGNAL
==1368==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000439000 (pc 0x00000042
89c7 bp 0x7ffc6391da50 sp 0x7ffc6391d750 T1368)
==1368==The signal is caused by a READ memory access.
    #0 0x4289c6 in crack /root/sandbox/crack.c:65:31
    #1 0x42809e in main /root/sandbox/crack.c:21:21
    #2 0x7f346c551b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.
c:310
    #3 0x402b89 in _start (/root/sandbox/crack+0x402b89)

UndefinedBehaviorSanitizer can not provide additional info.
==1368==ABORTING

Can someone tell me (or at least help me with) what this error means?

----UPDATE----

NEW CODE:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);
string deleteAll(string s, char target);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        if (strcmp(pw, "???") == 0)    // Signals an error (password not found).
        {
            return 2;
        }
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(6),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(6);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = (int) strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0,
        c5 = 0;
    // These things check if each loop is done.
    bool done1 = false,
         done2 = false,
         done3 = false,
         done4 = false,
         done5 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    while (!done5)
                    {
                        // Sets temp to the current pw (the loops guess in the following order: a, b, c, d, e..., Z, aa, ab, ac...zz, Aa, ...).
                        temp[0] = characters[c1];
                        temp[1] = characters[c2];
                        temp[2] = characters[c3];
                        temp[3] = characters[c4];
                        temp[4] = characters[c5];
                        temp[5] = '\0';
                        printf("%s\n", temp);
                        temp = deleteAll(temp, ' ');
                        // Checks if the pw is the correct one.
                        if (strcmp(crypt(temp, salt), hashed) == 0)
                        {
                            out = temp;    // Sets out to temp, and exits the loops
                            done1 = true;
                            done2 = true;
                            done3 = true;
                            done4 = true;
                            done5 = true;
                        }
                        if ((c1 == length - 1) &  // Sees if it should stop.
                            (c2 == length - 1) &
                            (c3 == length - 1) &
                            (c4 == length - 1))
                        {
                            out = "???";    // Sets out to ???, and exits the loops
                            done1 = true;
                            done2 = true;
                            done3 = true;
                            done4 = true;
                            done5 = true;
                        }
                        c5++;
                    }
                    c4++;
                }
                c3++;
            }
            c2++;
        }
        c1++;
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

And output:

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    
    /
    u
    s
    r
    /
    i
    n
    c
    l
    u
    d
    e
    /
    c
    r
    y
    p
    t
    .
    h
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    D
    

    
    j
    

    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    B
    
    
    F
    

    v
    

    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    

    F
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    H
    

    
    x
    0
    A
    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    
    $
    
    
    
    ,
    
    
    
    |
    d
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    A
    

    L
    
    
    
    P
    O
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    I
    

    
    
    
    E
    

    w
    
    (
    T
    
    0
    E
    
    8
    E
    
    @
    U
    
     
    
    `
    
    
    
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    D
    

    s
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    K
    

    `
    
    
    

    
    8
    D
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    O
    

    S
    

    
    8
    D
    
    P
    
    P
    u
    

    
     
    A
    
    
    A
    
    
    B
    
    
    F
    

    
    
    4
    
    
    
    8
    H
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    
    
    
    
    
    
    
    <
    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    
    Y
    

    
    (
    A
    
     
    B
    
    
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    K
    

    y
    

    
    0
    C
    
    (
    A
    
    
    B
    
    
    G
    

    n
    

    
    
    A
    
    
    B
    
    
    G
    

    W
    

    
    
    A
    
    
    B
    
    
    F
    
    K
    

    
    
    A
    
    
    B
    
    
    L
    

    
    N
    

    
    
    A
    
    
    B
    
    
    O
    
    G
    
    0
    
    s
    

    
    (
    A
    
     
    A
    
    
    B
    
    
    B
    
    
    G
    

    
    H
    
    @
    d
    
    H
    a
    
    P
    _
    
    H
    A
    
    @
    
    P
    

    
    (
    A
    
     
    A
    
    
    B
    
    
    B
    
    
    G
    

    
    
    A
    
    (
    A
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    T
    
    
    
    8
    S
    
    
    
    

    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    C
    

    
    
    
    
    8
    A
    
    0
    A
    
    (
    B
    
     
    B
    
    
    B
    
    
    B
    
    
    G
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
UndefinedBehaviorSanitizer:DEADLYSIGNAL
==1507==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000439000 (pc 0x000000428c1b bp 0x7fffd025c290 sp 0x7fffd025bf10 T1507)
==1507==The signal is caused by a READ memory access.
    #0 0x428c1a in crack /root/sandbox/crack.c:74:35
    #1 0x42809e in main /root/sandbox/crack.c:21:21
    #2 0x7ff8d403eb96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #3 0x402b89 in _start (/root/sandbox/crack+0x402b89)

UndefinedBehaviorSanitizer can not provide additional info.
==1507==ABORTING

crack.c: No response 😒

When I run my crack.c, the program never responds. It just sits there and wastes time. I even tried debugging it on the CS50 IDE, and it was normal. Here is my code:

#include <cs50.h>
#include <stdio.h>
#include <crypt.h>
#include <string.h>

string crack(string hashed);

// Deals with input and stuff and feeds info into functions.
int main(int argc, string argv[])
{
    // Returns 1 because this is an error (because there is no hashed pw).
    if (argc != 2)
    {
        printf("Usage: ./crack hash\n");
        return 1;
    }
    else
    {
        // Makes crack do all the 'hard work' of guess/checking.
        string pw = crack(argv[1]);
        // Prints the pw.
        printf("%s\n", pw);
        return 0;
    }
}

// Does all the 'hard work'.
string crack(string hashed)
{
    // A string is a list of chars, so this is easier than doing characters[0] = '\0'; ...
    string characters = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
           // A temporary variable that is useful for guessing.
           temp = malloc(6),
           // The salt for crypt() (salt will be defined in next two lines).
           salt = malloc(3),
           // The output.
           out = malloc(6);
    salt[0] = hashed[0];
    salt[1] = hashed[1];
    salt[2] = '\0';
    // Length will be used in the for loops in the next lines.
    int length = strlen(characters),
        c1 = 0,    // c1-4 are counters for the while loops.
        c2 = 0,
        c3 = 0,
        c4 = 0,
        c5 = 0;
    // These things check if each loop is done.
    bool done = false,
         done1 = false,
         done2 = false,
         done3 = false,
         done4 = false,
         done5 = false;
    while (!done1)
    {
        while (!done2)
        {
            while (!done3)
            {
                while (!done4)
                {
                    while (!done5)
                    {
                        temp[0] = characters[c1];   // Sets temp to characters[c1] characters[c2] etc.
                        temp[1] = characters[c2];
                        temp[2] = characters[c3];
                        temp[3] = characters[c4];
                        temp[4] = characters[c5];
                        temp[5] = '\0';
                        if (temp == NULL)   // Prevents segmentation errors.
                        {
                            printf("Segmentation error found.\nEnding Program");
                            done = true;
                        }
                        
                        else if (strcmp(crypt(temp, salt), hashed) == 0)    // Checks if it is done.
                        {
                            out = temp;
                            done = true;
                        }
                        else if (c5 > strlen(characters) - 1)   // Checks when to exit THIS loop
                        {
                            done5 = true;
                        }
                        c5++;
                    }
                    if (done)   // Increments c4 and sets c5 to 0.
                    {
                        break;
                    }
                    else if (c4 > strlen(characters) - 1)     // Checks when to exit THIS loop
                    {
                        done4 = true;
                    }
                    else
                    {
                        c5 = 0;
                        c4++;
                        done5 = false;
                    }
                }
                if (done)   // Increments c3 and sets c4 to 0.
                {
                    break;
                }
                else if (c3 > strlen(characters) - 1) // Checks when to exit THIS loop
                {
                    done3 = true;
                }
                else
                {
                    c4 = 0;
                    c3++;
                    done4 = false;
                }
            }
            if (done)   // Increments c2 and sets c3 to 0.
            {
                break;
            }
            else if (c2 > strlen(characters) - 1) // Checks when to exit THIS loop
            {
                done2 = true;
            }
            else
            {
                c3 = 0;
                c2++;
                done3 = false;
            }
        }
        if (done)   // Increments c1 and sets c2 to 0.
        {
            break;
        }
        else if (c1 > strlen(characters) - 1) // Checks when to exit THIS loop
        {
            done1 = true;
        }
        else
        {
            c2 = 0;
            c1++;
            done2 = false;
        }
    }
    return out;
}

string deleteAll(string s, char target)
{
    // Gets a string length.
    int length = (int) strlen(s), count = 0;
    // Sets the length of the output to the length of the input string (which is faster than calculating).
    string out = malloc(length);
    // Scans the input string and checks for target.
    for (int i = 0; i < length; i++)
    {
        if (!(s[i] == target))
        {
            out[count] = s[i];
            count++;
        }
    }
    return out;
}

Is my computer slow (because it sometimes is) or does the program have problems? Everytime I run it, it skips right over the hash. (You can see the code here, but please don't do anything bad. I WILL SEE IT)

New code
Source Link
fwoosh
  • 201
  • 1
  • 17
Loading
edited tags
Link
fwoosh
  • 201
  • 1
  • 17
Loading
Source Link
fwoosh
  • 201
  • 1
  • 17
Loading