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

mac osx build fixes for alloca et al #185

Merged
merged 2 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dump1090.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#include <sys/ioctl.h>
#include <time.h>
#include <limits.h>
#include <strings.h>
bovine marked this conversation as resolved.
Show resolved Hide resolved

#include "compat/compat.h"
#include "dsp/generated/starch.h"
Expand Down
7 changes: 6 additions & 1 deletion net_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,11 @@ void sendBeastSettings(struct client *c, const char *settings)
char *buf, *p;

len = strlen(settings) * 3;
buf = p = alloca(len);
buf = p = malloc(len);
if (!buf) {
fprintf(stderr, "Out of memory sending beast settings string\n");
exit(1);
}

while (*settings) {
*p++ = 0x1a;
Expand All @@ -1092,6 +1096,7 @@ void sendBeastSettings(struct client *c, const char *settings)
}

anetWrite(c->fd, buf, len);
free(buf);
}

// Move a network client to a new service
Expand Down