i got a stange behavior in my program, let me explain:

the function looks like this:

```
void PrintDirTree(const char* dirName, size_t depth)

```

then i have a while loop where i go trough the directory and make a new string for the next recursive call (printName is set before to 'examplefolder/'):

```
char* newDir = (char*)malloc(strlen(dirName) + strlen(dirEntry->d_name) + 1);
if (newDir != 0) {
    memset(newDir, 0, sizeof(*newDir));
    strcat(newDir, dirName);

    if (dirName[strlen(dirName)-1] != '/') {
        //printf("%d\n", dirName[strlen(dirName)-1]); <-- there i get the '5' 
        strcat(newDir, "/");
    }
    strcat(newDir, printName);
    PrintDirTree(newDir, depth + 1);
    free(newDir); newDir = 0;
} else {
    fprintf(stderr, "error allocating memory\n");
    return;
}

```

sometimes (but every time on the same directory) i get a ENQ (integer 5) at the end of the string **dirName** that is put to the next function call.
this misbehavior results in a incorrect opendir() call.