Module: kamailio
Branch: master
Commit: cc376804ef2bb5064bbff9e3c963a5d9222568b3
URL:
https://github.com/kamailio/kamailio/commit/cc376804ef2bb5064bbff9e3c963a5d…
Author: Dragos Vingarzan <vingarzan(a)gmail.com>
Committer: Dragos Vingarzan <vingarzan(a)gmail.com>
Date: 2024-07-09T09:22:36+02:00
core: added str2ushort() to avoid some questionable casting in ims_qos
---
Modified: src/core/ut.h
---
Diff:
https://github.com/kamailio/kamailio/commit/cc376804ef2bb5064bbff9e3c963a5d…
Patch:
https://github.com/kamailio/kamailio/commit/cc376804ef2bb5064bbff9e3c963a5d…
---
diff --git a/src/core/ut.h b/src/core/ut.h
index 1efd7abd242..aa51108229b 100644
--- a/src/core/ut.h
+++ b/src/core/ut.h
@@ -700,6 +700,14 @@ static inline int str2int(str *_s, unsigned int *_r)
str2unval(_s, _r, int, UINT_MAX);
}
+/*
+ * Convert a str to unsigned short
+ */
+static inline int str2ushort(str *_s, unsigned short *_r)
+{
+ str2unval(_s, _r, short, USHRT_MAX);
+}
+
#define str2snval(_s, _r, _vtype, _vmin, _vmax) \
do { \