ESP8266 Developer Zone The Official ESP8266 Forum 2016-07-08T13:44:10+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2409 2016-07-08T13:44:10+08:00 2016-07-08T13:44:10+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2409&p=7854#p7854 <![CDATA[Re: String functions defined in osapi.h]]>
Any string functions use pointers and the ESP8266 has hardware to access word aligned memory locations. That is why it is safer to use the array manipulation functions provided by Espressif rather than directly cast pointers.
If the other functions you tried work, you may continue to use them. But there is a possibility that they may fail with exceptions sometimes. But if your compiler takes care of boundary alignment then there should be no issue.

Statistics: Posted by Guest — Fri Jul 08, 2016 1:44 pm


]]>
2016-07-08T02:45:09+08:00 2016-07-08T02:45:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2409&p=7841#p7841 <![CDATA[String functions defined in osapi.h]]>
Some normal C string functions have equivalents defined in osapi.h. For example, os_strcpy is an alias for ets_strcpy. I thought maybe that was to avoid having to use libc, but other functions, like os_strcat, are direct aliases for libc functions. Why the difference?

I ask because I want to use other string.h functions, like strlcat. They seem to work fine, but I'm wondering if it will cause problems.

Thanks.

Statistics: Posted by jmo — Fri Jul 08, 2016 2:45 am


]]>