MCPcopy Create free account
hub / github.com/SIPp/sipp / sRepartitionInfo

Method sRepartitionInfo

src/stat.cpp:1118–1143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1116}
1117
1118char* CStat::sRepartitionInfo(T_dynamicalRepartition * tabRepartition,
1119 int sizeOfTab)
1120{
1121 static char *repartitionInfo;
1122 char buffer[MAX_CHAR_BUFFER_SIZE];
1123 int dlen = strlen(stat_delimiter);
1124
1125 if(tabRepartition != nullptr) {
1126 // if a repartition is present, this field match the repartition name
1127 repartitionInfo = (char *)realloc(repartitionInfo, dlen + 1);
1128 sprintf(repartitionInfo, "%s", stat_delimiter);
1129 for(int i=0; i<(sizeOfTab-1); i++) {
1130 sprintf(buffer, "%lu%s", tabRepartition[i].nbInThisBorder, stat_delimiter);
1131 repartitionInfo = (char *)realloc(repartitionInfo, strlen(repartitionInfo) + strlen(buffer) + 1);
1132 strcat(repartitionInfo, buffer);
1133 }
1134 sprintf(buffer, "%lu%s", tabRepartition[sizeOfTab-1].nbInThisBorder, stat_delimiter);
1135 repartitionInfo = (char *)realloc(repartitionInfo, strlen(repartitionInfo) + strlen(buffer) + 1);
1136 strcat(repartitionInfo, buffer);
1137 } else {
1138 repartitionInfo = (char *)realloc(repartitionInfo, 2);
1139 repartitionInfo[0] = '\0';
1140 }
1141
1142 return(repartitionInfo);
1143}
1144
1145void CStat::dumpData ()
1146{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected