1 |
The following code snippet compiles find but when run it just hangs forever: |
2 |
|
3 |
$ cat x.c |
4 |
#include <stdio.h> |
5 |
#include <unistd.h> |
6 |
#include <crypt.h> |
7 |
|
8 |
int main() { |
9 |
printf("Running test\n"); |
10 |
char *encrypted = crypt("blablabla","ab"); |
11 |
if(!encrypted || strcmp(encrypted,"ab.h7fshjf89f")) { |
12 |
printf("Fail\n"); |
13 |
} else { |
14 |
printf("OK\n"); |
15 |
} |
16 |
} |
17 |
|
18 |
$ gcc -o xout x.c -lcrypt |
19 |
|
20 |
$ ./xout |
21 |
Running test |
22 |
|
23 |
<here the program just hangs and needs to be killed with ^C> |
24 |
|
25 |
The same code runs fine on my desktop. |
26 |
Any suggestions what could be my problem? |
27 |
|
28 |
-- |
29 |
Dan Johansson, <http://www.dmj.nu> |
30 |
*************************************************** |
31 |
This message is printed on 100% recycled electrons! |
32 |
*************************************************** |