<html>
<head>
<meta content="text/html; charset=iso-8859-2"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Musite pocitat aj s koncovym NULL:<br>
<br>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-2">
<pre style="font-family: monospace; font-size: 1.1em; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Unlike those
functions, <b style="color: rgb(153, 102, 0); font-weight: bold;">strlcpy</b>() and <b style="color: rgb(153, 102, 0); font-weight: bold;">strlcat</b>() take the full size of the buffer (not
just the length) and guarantee to NUL-terminate the result (as long as
<i style="color: rgb(0, 128, 0);">size</i> is larger than 0 or, in the case of <b style="color: rgb(153, 102, 0); font-weight: bold;">strlcat</b>(), as long as there is
at least one byte free in <i style="color: rgb(0, 128, 0);">dst</i>). Note that a byte for the NUL should be
included in <i style="color: rgb(0, 128, 0);">size</i>.</pre>
<br>
<br>
<div class="moz-cite-prefix">On 05/10/2016 09:52 AM, Zdeněk Aster
wrote:<br>
</div>
<blockquote cite="mid:1mh.qW6.4zsfqH3XQG9.1NCPCu@seznam.cz"
type="cite">Zdravim,
<div> ja uz jsem asi fakt blbej. Ja mel za to, ze funkce strlcpy
kopiruje, do maximalni</div>
<div>delky retezce bez ukoncovaci 0.</div>
<div><br>
</div>
<div>char retezec[10];</div>
<div><br>
</div>
<div>strlcpy( retezec, "123456790ABCD", 9 );</div>
<div>vysledek retezec je 12345678</div>
<div><br>
</div>
<div>Ale on mi to bere i s nulou. Takze fakt tam musí být skutečná
maximální delka</div>
<div>řetězce včetně ukoncovaci nuly takže místo 9ky 10ky?</div>
<div><br>
</div>
<div><br>
</div>
<div>Zdeněk Aster</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
HW-list mailing list - sponsored by <a class="moz-txt-link-abbreviated" href="http://www.HW.cz">www.HW.cz</a>
<a class="moz-txt-link-abbreviated" href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</a>
<a class="moz-txt-link-freetext" href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
iko
Počítač bez Windows je ako kakao bez kečupu.</pre>
</body>
</html>