.ai_canonname = NULL,
.ai_next = NULL
};
- const char* trb3_port = NULL;
+ char trb3Server[256] = "";
+ const char *trb3_port = NULL;
char* tmp = NULL;
int status = -1;
/* Get TRB3 IP-Address */
tmp = getenv("TRB3_SERVER");
if (tmp != NULL) {
- char* separator = NULL;
- if ((separator = rindex(tmp, ':')) != NULL) {
+ char *separator = NULL;
+ strncpy(trb3Server, tmp, 256);
+ if ((separator = rindex(trb3Server, ':')) != NULL) {
*separator = '\0';
trb3_port = separator + 1;
} else {
trb3_port = TRB3_UDP_PORT_NEW;
}
- strncpy(trb3_server, tmp, NI_MAXHOST);
+ strncpy(trb3_server, trb3Server, NI_MAXHOST);
} else {
/* Choose default name and port */
trb3_port = TRB3_UDP_PORT_OLD;
.ai_canonname = NULL,
.ai_next = NULL
};
- const char* trb3_port = NULL;
- char* tmp = NULL;
+ char trb3Server[256] = "";
+ const char *trb3_port = NULL;
+ const char *tmp = NULL;
int status = -1;
trb_errno = TRB_NONE;
/* Get TRB3 IP-Address */
tmp = getenv("TRB3_SERVER");
if (tmp != NULL) {
- char* separator = NULL;
- if ((separator = rindex(tmp, ':')) != NULL) {
+ char *separator = NULL;
+ strncpy(trb3Server, tmp, 256);
+ if ((separator = rindex(trb3Server, ':')) != NULL) {
*separator = '\0';
trb3_port = separator + 1;
} else {
trb3_port = TRB3_UDP_PORT_NEW;
}
- strncpy(trb3_server, tmp, NI_MAXHOST);
+ strncpy(trb3_server, trb3Server, NI_MAXHOST);
} else {
/* Choose default name and port */
trb3_port = TRB3_UDP_PORT_OLD;
install: $(TARGETS)
mkdir -p $(DESTDIR)/bin
- install -m 775 $(TARGETS) $(DESTDIR)/bin/
+ install -m 775 $(TARGETS) $(DESTDIR)/binlocal/
# ------------ Dependencies --------------------------------------------
uint32_t server_rpc_prog_id = TRBNETRPCPROG;
if (server == NULL) {
- char *tmp;
+ char daqopServer[256] = "";
+ const char *tmp;
tmp = getenv("DAQOPSERVER");
if (tmp != NULL) {
uint32_t id = 0;
char* separator = NULL;
- if ((separator = rindex(tmp, ':')) != NULL) {
+ strncpy(daqopServer, tmp, 256);
+ if ((separator = rindex(daqopServer, ':')) != NULL) {
*separator = '\0';
id = strtoul(separator + 1, NULL, 0);
}
- strncpy(trb_server, tmp, 128);
+ strncpy(trb_server, daqopServer, 128);
server_rpc_prog_id = ((server_rpc_prog_id & 0xffff00ff) | (id << 8));
} else {
sprintf(trb_server, "etraxp023");