Plan 9 from Bell Labs’s /usr/web/sources/patch/ndb-remove-cast/readme

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


strange one this: for ages this code
		if(strchr((char *)rp->host, '\n') != nil) {
has been doing a strchr on an rp->host, which is a DN*, not by any means a string.
without the cast, the compiler dutifully warns about it too.
perhaps casting uchar* to char* was force of habit? i've replaced it by rp->host->name,
which at least should be technically correct, but the test itself seems curious to me.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.