From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7GCSBEC017092 for ; Tue, 16 Aug 2011 14:28:11 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AosBALRhSk7RVdg2kGdsb2JhbABBqCsIFAEBAQEJCQ0HFAQhgUABAQEBAxICLAEbHgMMBgULOyEBAREBBQEcBhMio0AKjDeCVYU8O4htAgMGhkIEh1mLOYl2gmM8g2U X-IronPort-AV: E=Sophos;i="4.67,380,1309730400"; d="scan'208";a="105584830" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 16 Aug 2011 14:28:06 +0200 Received: by qwc9 with SMTP id 9so5167064qwc.27 for ; Tue, 16 Aug 2011 05:28:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=HC69t8x5GpLB2PkWCJmA+z85AUYsraz6r0taMx4P8fc=; b=Y9w293gYa2kZWfnplY3sdAU41AADIng48HD4XUe3XWiLOFLuxgVDg09lZ9oGc8Varh I7X3ZGbXpZZt1I2cOOMsuCgGXa0sL/U9LdowvW4U6SQX40ixzN0L58mvTJeePBTl5Yl8 LRsMxhQfpztIsMqs8TP/tVFbY/jtceNvKG9bs= MIME-Version: 1.0 Received: by 10.229.19.193 with SMTP id c1mr3346331qcb.118.1313497684984; Tue, 16 Aug 2011 05:28:04 -0700 (PDT) Received: by 10.229.76.229 with HTTP; Tue, 16 Aug 2011 05:28:04 -0700 (PDT) In-Reply-To: References: Date: Tue, 16 Aug 2011 16:28:04 +0400 Message-ID: From: Dmitry Bely To: Caml List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p7GCSBEC017092 Subject: [Caml-list] Re: Interfacing with C: bad practice On Tue, Aug 16, 2011 at 11:37 AM, Dmitry Bely wrote: (...) >    while (*s != NULL) { >        list = wrp_ml_cons(caml_copy_string(*s), list); /* bug! */ >    } Ah, s increment is missing. The loop should be written as for (; *s != NULL; s++) { list = wrp_ml_cons(caml_copy_string(*s), list); /* bug! */ } - Dmitry Bely