<feed xmlns='http://www.w3.org/2005/Atom'>
<title>openbsd/src/lib/libc/stdlib/lsearch.c, branch OPENBSD_7_9</title>
<subtitle>A mirror of https://github.com/libressl/openbsd.git
</subtitle>
<id>https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9</id>
<link rel='self' href='https://git.lua4.win/openbsd/atom?h=OPENBSD_7_9'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/'/>
<updated>2021-12-08T22:06:28+00:00</updated>
<entry>
<title>lsearch(3): reimplement using lfind(3)</title>
<updated>2021-12-08T22:06:28+00:00</updated>
<author>
<name>cheloha</name>
<email></email>
</author>
<published>2021-12-08T22:06:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=8b24559bc32a8fcd130978a513c42659ebf278de'/>
<id>urn:sha1:8b24559bc32a8fcd130978a513c42659ebf278de</id>
<content type='text'>
lsearch(3) is really just lfind(3) with an additional branch to append
the key if lfind(3) fails.  If we get rid of the underlying
linear_base() function and move the search portion into lfind(3) and
the key-copying portion into lsearch(3) we get smaller and simpler
code.

Misc. notes:

- We do not need to keep the historical comment about errno.  lsearch(3)
  is pure computation and does not set errno.  That's really all you
  need to know.  The specification reserves no errors, either.

- We are using lfind(3) internally now, so it switches from
  PROTO_DEPRECATED to PROTO_NORMAL in hidden/search.h and needs
  DEF_WEAK in stdlib/lsearch.c.

With advice from guenther@ on symbol housekeeping in libc.

Thread: https://marc.info/?l=openbsd-tech&amp;m=163885187632449&amp;w=2

ok millert@
</content>
</entry>
<entry>
<title>lsearch(3): append key to array with memmove(3) instead of memcpy(3)</title>
<updated>2021-12-07T04:01:45+00:00</updated>
<author>
<name>cheloha</name>
<email></email>
</author>
<published>2021-12-07T04:01:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=cfc78852fcba382d04261ab49ed38b22e811e417'/>
<id>urn:sha1:cfc78852fcba382d04261ab49ed38b22e811e417</id>
<content type='text'>
If the key overlaps the end of the array, memcpy(3) mutates the key
and copies a corrupted value into the end of the array.

If we use memmove(3) instead we at least end up with a clean copy of
the key at the end of the array.  This is closer to the intended
behavior.

With input from millert@ and deraadt@.

Thread: https://marc.info/?l=openbsd-tech&amp;m=163880307403606&amp;w=2

ok millert@
</content>
</entry>
<entry>
<title>Change lsearch()'s "base" argument to require a non-const pointer to</title>
<updated>2014-07-18T04:16:09+00:00</updated>
<author>
<name>matthew</name>
<email></email>
</author>
<published>2014-07-18T04:16:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=526aecf5e5a99b846201c093c8f4aed7d06676a7'/>
<id>urn:sha1:526aecf5e5a99b846201c093c8f4aed7d06676a7</id>
<content type='text'>
align with POSIX and other systems.

Pointed out by Elliott Hughes on tech
ok deraadt
</content>
</entry>
<entry>
<title>rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and</title>
<updated>2009-10-27T23:59:59+00:00</updated>
<author>
<name>deraadt</name>
<email></email>
</author>
<published>2009-10-27T23:59:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=4e04ad15cf88ddc52057cc9d19ae371de3d509c2'/>
<id>urn:sha1:4e04ad15cf88ddc52057cc9d19ae371de3d509c2</id>
<content type='text'>
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
</content>
</entry>
<entry>
<title>add some missing $, ok djm@ 'That looks fine to me' millert@</title>
<updated>2004-10-01T04:08:45+00:00</updated>
<author>
<name>jsg</name>
<email></email>
</author>
<published>2004-10-01T04:08:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=286f2c9acc73fa2c79290ce6e5c7437d99f9f865'/>
<id>urn:sha1:286f2c9acc73fa2c79290ce6e5c7437d99f9f865</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Remove the advertising clause in the UCB license which Berkeley</title>
<updated>2003-06-02T20:18:38+00:00</updated>
<author>
<name>millert</name>
<email></email>
</author>
<published>2003-06-02T20:18:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=021d32a253720a2fcdb07690f59c7e08d1d661e6'/>
<id>urn:sha1:021d32a253720a2fcdb07690f59c7e08d1d661e6</id>
<content type='text'>
rescinded 22 July 1999.  Proofed by myself and Theo.
</content>
</entry>
<entry>
<title>move lsearch(3) and insque(3) from libcompat -&gt; libc; they are now POSIX</title>
<updated>2003-05-08T23:21:36+00:00</updated>
<author>
<name>millert</name>
<email></email>
</author>
<published>2003-05-08T23:21:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/openbsd/commit/?id=904702870b8643c3707b8b8747e4c6814f2afa54'/>
<id>urn:sha1:904702870b8643c3707b8b8747e4c6814f2afa54</id>
<content type='text'>
</content>
</entry>
</feed>
