running small program in telnet

I compiled a small programm and it runs fine from a login shell.
when I start it from a telnet session, I get the error message ‘memory fault - core dumped’, and the program exits.

I really don’t want you to dig through the code, for a start I would just like to know if this sounds like a ‘typical beginner’s mistake’ and what would be the next step. A short hint will do, since 'm used to learn by myself.

Thank you, Helge

I assume by “a login shell” you mean a console.

So what you should think about is what is different in the two environments. Using telnet, before you run the program, run stty without any parameters. The first line will be something like this:

Name: /dev/ttyp3

This device is a pseudo tty device, in the case of QNX created by devc-pty. While it tries to create an equivalent environment to /dev/con#, it is not identical. It is likely that your program is making an assumption that is wrong in the case of a pseudo-tty.
That’s about all I can with this limited information.

I imagine if you put some printf’s in your program, and track down where the abend occurs, it will become obvious what is wrong. Alternatively you could use a post-mortem core dump to find this location.

thank you for pointing.
I guess I’ll have to read some more.