Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return pointer to local variable #1

Open
uscmule opened this issue Sep 5, 2017 · 2 comments
Open

Return pointer to local variable #1

uscmule opened this issue Sep 5, 2017 · 2 comments

Comments

@uscmule
Copy link

uscmule commented Sep 5, 2017

If you have hard to find crashes using this code, this is probably why:

char *read_server(int client) {
// read data from the client
char input[1024] = { 0 };
......

return input;

}

@RyanGlScott
Copy link
Owner

Hi @uscmule:

It's worth noting that this is a bunch of haphazard code I threw together as an undergraduate, so it doesn't surprise me in the least that there's lurking bugs. Do note that I haven't written Android code in years, so it's unlikely I'll change this repo in the foreseeable future.

If this code is useful for you, I'd be happy to give you ownership.

@uscmule
Copy link
Author

uscmule commented Sep 8, 2017

No thanks, was just reading it, and that stuck out... figured I'd throw up a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants