Skip to content

Commit 691216a

Browse files
fix incorrect formatting #1288 this time in the right branch...
1 parent 3e58d4b commit 691216a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source_modules/spectran_http_source/src/spectran_http_client.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "spectran_http_client.h"
22
#include <utils/flog.h>
3+
#include <inttypes.h>
34

45
SpectranHTTPClient::SpectranHTTPClient(std::string host, int port, dsp::stream<dsp::complex_t>* stream) {
56
this->stream = stream;
@@ -50,10 +51,10 @@ void SpectranHTTPClient::setCenterFrequency(uint64_t freq) {
5051
// Make request
5152
net::http::RequestHeader rqhdr(net::http::METHOD_PUT, "/control", host);
5253
char buf[1024];
53-
sprintf(buf, "{\"frequencyCenter\":%d,\"frequencySpan\":%d,\"type\":\"capture\"}", freq, _samplerate);
54+
sprintf(buf, "{\"frequencyCenter\":%" PRIu64 ",\"frequencySpan\":%" PRIu64 ",\"type\":\"capture\"}", freq, _samplerate);
5455
std::string data = buf;
5556
char lenBuf[16];
56-
sprintf(lenBuf, "%d", data.size());
57+
sprintf(lenBuf, "%" PRIu64, data.size());
5758
rqhdr.setField("Content-Length", lenBuf);
5859
controlHttp.sendRequestHeader(rqhdr);
5960
controlSock->sendstr(data);

0 commit comments

Comments
 (0)