Cyclone (programming language): Difference between revisions

Content deleted Content added
Rescuing 1 sources and tagging 0 as dead. #IABot (v2.0beta5)
Pointer types: Fix example
Line 81:
}
</source>
This function assumes that the string being passed in is terminated by NULL (<code>'\0'</code>). However, what would happen if <code>char&nbsp;buf[6]&nbsp;=&nbsp;{'h','e','l','l','o','!'};</code> were passed to this string? This is perfectly legal in C, yet would cause <code>strlen</code> to iterate through memory not necessarily associated with the string <code>s</code>. There are functions, such as <code>strnlen</code> which can be used to avoid such problems, but these functions are not standard with every implementation of [[ANSI C]]. The Cyclone version of <code>strlen</code> is not so different from the C version:
<source lang="C">
int strlen(const char ? s)