Module: kamailio
Branch: master
Commit: cc376804ef2bb5064bbff9e3c963a5d9222568b3
URL: 
https://github.com/kamailio/kamailio/commit/cc376804ef2bb5064bbff9e3c963a5d9222568b3

Author: Dragos Vingarzan <vingar...@gmail.com>
Committer: Dragos Vingarzan <vingar...@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/cc376804ef2bb5064bbff9e3c963a5d9222568b3.diff
Patch: 
https://github.com/kamailio/kamailio/commit/cc376804ef2bb5064bbff9e3c963a5d9222568b3.patch

---

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 {                                                                    
   \

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to