14ecbd6dmarkm/* 233f661cstas * Copyright (c) 1995 - 1999 Kungliga Tekniska H��gskolan 34ecbd6dmarkm * (Royal Institute of Technology, Stockholm, Sweden). 44ecbd6dmarkm * All rights reserved. 533f661cstas * 64ecbd6dmarkm * Redistribution and use in source and binary forms, with or without 74ecbd6dmarkm * modification, are permitted provided that the following conditions 84ecbd6dmarkm * are met: 933f661cstas * 104ecbd6dmarkm * 1. Redistributions of source code must retain the above copyright 114ecbd6dmarkm * notice, this list of conditions and the following disclaimer. 1233f661cstas * 134ecbd6dmarkm * 2. Redistributions in binary form must reproduce the above copyright 144ecbd6dmarkm * notice, this list of conditions and the following disclaimer in the 154ecbd6dmarkm * documentation and/or other materials provided with the distribution. 1633f661cstas * 174ecbd6dmarkm * 3. Neither the name of the Institute nor the names of its contributors 184ecbd6dmarkm * may be used to endorse or promote products derived from this software 194ecbd6dmarkm * without specific prior written permission. 2033f661cstas * 214ecbd6dmarkm * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 224ecbd6dmarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 234ecbd6dmarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 244ecbd6dmarkm * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 254ecbd6dmarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 264ecbd6dmarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 274ecbd6dmarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 284ecbd6dmarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 294ecbd6dmarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 304ecbd6dmarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 314ecbd6dmarkm * SUCH DAMAGE. 324ecbd6dmarkm */ 334ecbd6dmarkm 344ecbd6dmarkm#include <config.h> 354ecbd6dmarkm 364ecbd6dmarkm#include "roken.h" 374ecbd6dmarkm 3833f661cstasROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL 394ecbd6dmarkmstrnlen(const char *s, size_t len) 404ecbd6dmarkm{ 414ecbd6dmarkm size_t i; 424ecbd6dmarkm 434ecbd6dmarkm for(i = 0; i < len && s[i]; i++) 444ecbd6dmarkm ; 454ecbd6dmarkm return i; 464ecbd6dmarkm} 47