mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed compiler warning
This commit is contained in:
parent
7b4e3a7eb3
commit
6ad17c7150
@ -256,7 +256,7 @@ void add_crlf(char *buffer, int bufsize)
|
|||||||
char *p;
|
char *p;
|
||||||
char *tmpbuf;
|
char *tmpbuf;
|
||||||
|
|
||||||
tmpbuf = malloc(bufsize);
|
tmpbuf = (char *)malloc(bufsize);
|
||||||
|
|
||||||
/* convert \n -> \r\n */
|
/* convert \n -> \r\n */
|
||||||
p = buffer;
|
p = buffer;
|
||||||
@ -797,7 +797,7 @@ INT submit_elog(char *host, int port, int ssl, char *subdir, char *experiment,
|
|||||||
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
for (i = 0; i < MAX_ATTACHMENTS; i++)
|
||||||
if (afilename[i][0])
|
if (afilename[i][0])
|
||||||
content_length += buffer_size[i];
|
content_length += buffer_size[i];
|
||||||
content = malloc(content_length);
|
content = (char *)malloc(content_length);
|
||||||
if (content == NULL) {
|
if (content == NULL) {
|
||||||
printf("Not enough memory\n");
|
printf("Not enough memory\n");
|
||||||
return -1;
|
return -1;
|
||||||
@ -1230,7 +1230,7 @@ int main(int argc, char *argv[])
|
|||||||
att_size[i] = lseek(fh, 0, SEEK_END);
|
att_size[i] = lseek(fh, 0, SEEK_END);
|
||||||
lseek(fh, 0, SEEK_SET);
|
lseek(fh, 0, SEEK_SET);
|
||||||
|
|
||||||
buffer[i] = malloc(att_size[i] + 1);
|
buffer[i] = (char *)malloc(att_size[i] + 1);
|
||||||
|
|
||||||
n = read(fh, buffer[i], att_size[i]);
|
n = read(fh, buffer[i], att_size[i]);
|
||||||
if (n < att_size[i]) {
|
if (n < att_size[i]) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user