Skip to content

Commit

Permalink
WIP addressing #162, #150
Browse files Browse the repository at this point in the history
  • Loading branch information
cbuahin committed Feb 15, 2024
1 parent ea5e68a commit e1f906e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/outfile/swmm_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int EXPORT_OUT_API SMO_open(SMO_Handle p_handle, const char *path)
else {

#ifdef _MSC_VER
strncpy_s(p_data->name, path, MAXFILENAME);
strncpy_s(p_data->name, MAXFILENAME, path, MAXFILENAME);
#else
strncpy(p_data->name, path, MAXFILENAME);
#endif
Expand Down Expand Up @@ -532,8 +532,12 @@ int EXPORT_OUT_API SMO_getElementName(SMO_Handle p_handle, SMO_elementType type,
*name = newCharArray(*length + 1);
// Writes IDname and an additional null character to name


#ifdef _MSC_VER
strncpy_s(*name, p_data->elementNames[idx].IDname,
strncpy_s(
*name,
(*length + 1) * sizeof(char),
p_data->elementNames[idx].IDname,
(*length + 1) * sizeof(char));
#else
strncpy(*name, p_data->elementNames[idx].IDname,
Expand Down
3 changes: 2 additions & 1 deletion src/solver/swmm5.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,8 @@ double DLLEXPORT swmm_getValue(int property, int index)
return getNodeValue(property, index);
if (property < 500)
return getLinkValue(property, index);
return ERR_API_NO_DATA;

return ERR_API_PROPERTY_TYPE;
}

//=============================================================================
Expand Down

0 comments on commit e1f906e

Please sign in to comment.