Skip to content

Commit

Permalink
Fix issues with c code
Browse files Browse the repository at this point in the history
Signed-off-by: Elijah Swift <elijah.swift@ibm.com>
  • Loading branch information
ElijahSwiftIBM committed Nov 1, 2023
1 parent 8890a5d commit 3b9d1d5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyracf/common/irrsmo00.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ typedef struct {
char str[8];
} VarStr_T;

static char* null_byte_fix(char* string) {
for (int i = 1; i < rsp_len; i++){
if (rsp[i] == 0) {
if (rsp[i-1] == 0x6E) {
void null_byte_fix(char* str, unsigned int str_len) {
for (int i = 1; i < str_len; i++){
if (str[i] == 0) {
if (str[i-1] == 0x6E) {
break;
}
else {
rsp[i] = 0x40;
str[i] = 0x40;
}
}
}
Expand Down Expand Up @@ -68,7 +68,7 @@ static PyObject* call_irrsmo00(PyObject* self, PyObject* args, PyObject *kwargs)
rsp
);

rsp = null_byte_fix(rsp);
null_byte_fix(rsp,rsp_len);
return Py_BuildValue("y", rsp);
}

Expand Down

0 comments on commit 3b9d1d5

Please sign in to comment.