Code Review
/
sim
/
o1-interface.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add VES stndDefined PM and subscription for O-DU.
[sim/o1-interface.git]
/
ntsimulator
/
ntsim-ng
/
utils
/
sys_utils.c
diff --git
a/ntsimulator/ntsim-ng/utils/sys_utils.c
b/ntsimulator/ntsim-ng/utils/sys_utils.c
index
d6def2e
..
9b49995
100644
(file)
--- a/
ntsimulator/ntsim-ng/utils/sys_utils.c
+++ b/
ntsimulator/ntsim-ng/utils/sys_utils.c
@@
-88,12
+88,13
@@
char *file_read_content(const char *fname) {
fseek(f, 0, SEEK_END);
length = ftell(f);
fseek(f, 0, SEEK_SET);
fseek(f, 0, SEEK_END);
length = ftell(f);
fseek(f, 0, SEEK_SET);
- buffer = (char*)malloc(sizeof(char) *
length
);
+ buffer = (char*)malloc(sizeof(char) *
(length + 1)
);
if(buffer) {
fread(buffer, 1, length, f);
}
fclose(f);
}
if(buffer) {
fread(buffer, 1, length, f);
}
fclose(f);
}
+ buffer[length] = 0;
return buffer;
}
return buffer;
}