Refine the helper function

This commit is contained in:
Max Lv
2019-06-30 22:32:54 +08:00
parent ab9764dbdf
commit f0205e7f13
2 changed files with 8 additions and 7 deletions
+7
View File
@@ -551,3 +551,10 @@ get_default_conf(void)
return "config.json";
#endif
}
uint16_t load16_be(const void *s)
{
const uint8_t *in = (const uint8_t *)s;
return ((uint16_t)in[0] << 8)
| ((uint16_t)in[1]);
}