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

1.7 jk fix1 #2

Open
wants to merge 2 commits into
base: hashpipe-1.7-devel
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions src/hashpipe_ibverbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,11 @@ int hashpipe_ibv_flow(
return 1;
} // switch(flow_type)

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
if(!(hibv_ctx->ibv_flows[flow_idx] =
ibv_create_flow(hibv_ctx->qp, (struct ibv_flow_attr *)&flow))) {
#pragma GCC diagnostic pop
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/hashpipe_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void hashpipe_status_chkinit(hashpipe_status_t *s)
/* Fill first record w/ spaces */
memset(s->buf, ' ', HASHPIPE_STATUS_RECORD_SIZE);
/* add END */
strncpy(s->buf, "END", 3);
memcpy(s->buf, "END", 3*sizeof(char));
// Add INSTANCE record
hputi4(s->buf, "INSTANCE", s->instance_id);
} else {
Expand Down Expand Up @@ -224,7 +224,7 @@ void hashpipe_status_clear(hashpipe_status_t *s) {
/* Fill first record w/ spaces */
memset(s->buf, ' ', HASHPIPE_STATUS_RECORD_SIZE);
/* add END */
strncpy(s->buf, "END", 3);
memcpy(s->buf, "END", 3*sizeof(char));

hputi4(s->buf, "INSTANCE", s->instance_id);

Expand Down
25 changes: 16 additions & 9 deletions src/hput.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ const char *cval; /* character string containing the value for variable

/* Put single quote at start of string */
value[0] = squot;
strncpy (&value[1],cval,lcval);
//strncpy (&value[1],cval,lcval);
memcpy(&value[1],cval,lcval*sizeof(char));

/* If string is less than eight characters, pad it with spaces */
if (lcval < 8) {
Expand Down Expand Up @@ -497,7 +498,7 @@ const char *value; /* character string containing the value for variable
v2 = v1 + 80;

/* Insert keyword8 */
strncpy (v1,keyword8,7);
memcpy(v1,keyword8,7*sizeof(char));

/* Pad with spaces */
for (vp = v1+lkeyword; vp < v2; vp++)
Expand Down Expand Up @@ -589,11 +590,13 @@ const char *value; /* character string containing the value for variable
}

/* Fill new entry with spaces */
//memset(v1,' ', v2-v1);
for (vp = v1; vp < v2; vp++)
*vp = ' ';

/* Copy keyword8 to new entry */
strncpy (v1, keyword8, lkeyword);
//strncpy (v1, keyword8, lkeyword);
memcpy (v1, keyword8, lkeyword*sizeof(char));

/* Add parameter value in the appropriate place */
/*
Expand All @@ -612,15 +615,16 @@ const char *value; /* character string containing the value for variable
*vp = ' ';
vp = vp + 1;
if (*value == squot) {
strncpy (vp, value, lval);
//strncpy (vp, value, lval);
memcpy (vp, value, lval*sizeof(char));
if (lval+12 > 31)
lc = lval + 12;
else
lc = 30;
}
else {
vp = v1 + 30 - lval;
strncpy (vp, value, lval);
memcpy (vp, value, lval*sizeof(char));
lc = 30;
}

Expand Down Expand Up @@ -697,6 +701,8 @@ hputcom (hstring,keyword,comment)
strncpy (v2, v1, 80);

/* blank out new line and insert keyword */
//memset(v1,' ',v2-v1);
//memset(v1,' ',80); //FIXME: JK: isn't it more efficient?
for (vp = v1; vp < v2; vp++)
*vp = ' ';
strncpy (v1, keyword, lkeyword);
Expand Down Expand Up @@ -766,7 +772,7 @@ hputcom (hstring,keyword,comment)
/* If comment will not fit at all, return */
if (c0 - v1 > 77)
return (-1);
strncpy (c0, " / ",3);
memcpy(c0, " / ",3*sizeof(char));
}

/* Create new entry */
Expand Down Expand Up @@ -890,7 +896,8 @@ const char *keyword; /* Keyword of entry to be deleted */

/* Cover former first line with new keyword */
lkey = (int) strlen (keyword);
strncpy (hplace, keyword, lkey);
//strncpy (hplace, keyword, lkey);
memcpy (hplace, keyword, lkey*sizeof(char));
if (lkey < 8) {
for (i = lkey; i < 8; i++)
hplace[i] = ' ';
Expand Down Expand Up @@ -1237,7 +1244,7 @@ double deg; /* Angle in degrees */
int ndec; /* Number of decimal places in degree string */

{
char degform[8];
char degform[25];
int field, ltstr;
char tstring[64];
double deg1;
Expand Down Expand Up @@ -1290,7 +1297,7 @@ int field; /* Number of characters in output field (0=any) */
int ndec; /* Number of decimal places in degree string */

{
char numform[8];
char numform[24];

if (field > 0) {
if (ndec > 0) {
Expand Down