summaryrefslogtreecommitdiffstats
path: root/sesman/libscp/libscp_v1s_mng.c
diff options
context:
space:
mode:
Diffstat (limited to 'sesman/libscp/libscp_v1s_mng.c')
-rw-r--r--sesman/libscp/libscp_v1s_mng.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sesman/libscp/libscp_v1s_mng.c b/sesman/libscp/libscp_v1s_mng.c
index 9c31cec6..3a3e1d98 100644
--- a/sesman/libscp/libscp_v1s_mng.c
+++ b/sesman/libscp/libscp_v1s_mng.c
@@ -188,11 +188,18 @@ scp_v1s_mng_list_sessions(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
struct SCP_DISCONNECTED_SESSION *cds;
/* calculating the number of packets to send */
- pktcnt = sescnt / SCP_SERVER_MAX_LIST_SIZE;
-
- if ((sescnt % SCP_SERVER_MAX_LIST_SIZE) != 0)
+ if (sescnt == 0)
+ {
+ pktcnt = 1;
+ }
+ else
{
- pktcnt++;
+ pktcnt = sescnt / SCP_SERVER_MAX_LIST_SIZE;
+
+ if ((sescnt % SCP_SERVER_MAX_LIST_SIZE) != 0)
+ {
+ pktcnt++;
+ }
}
for (idx = 0; idx < pktcnt; idx++)