From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg0-f41.google.com ([74.125.83.41]) by ur; Mon Mar 27 23:33:46 EDT 2017 Received: by mail-pg0-f41.google.com with SMTP id 21so59350912pgg.1 for <9front@9front.org>; Mon, 27 Mar 2017 20:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=wLIeYKT2w3lkgXlTD6cSE6fVa2jXLwldf0MItYC7uO0=; b=t9TvZ3P54dxWT6xqf89rFDJzyzpRPeUPr+LT+g8IbGBKnCYjgGOfDR9mvP1C/2xMNa GcvmqxlIJyuyhlYa3nqgh7c5UeVVzI4eayeQtvxDx+eGJWu0/0GrGmTg1JTULVzi2Qdn B+TDHVCpkX3hJzwE0bhnm9qIbh3BEG2NnKYVOGPpN8SORXtxdjTEWsupNpeCtSc8VyKi nST3/qCjjP2++2BGV4RIAR63REdzI4PBHRSUmTCm/o+QEHMqqJ/YWY+xZONZIFU8Feqe JRdGJUtBySRc+Sl8rXgoKtw3QwszWLa1HkL8R2qyOMt9nvRd1i2Aw1ZbsOxZW/Lripwx I1TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=wLIeYKT2w3lkgXlTD6cSE6fVa2jXLwldf0MItYC7uO0=; b=t1wPRZXFNq2DQbYQz0ro9bhn0ZMFHhmp3RXw35X6GGtvaTVGa7dIxNE4W2YNN8IrQb JyAWGUweh87mmqycYe8ZJTTOZZAxOehoFF1F6U86dw44fFhHbugTQJtVKWetTa4j2pVa B3Hf/D0DGZFlMD5syk1QKD4cf/e3EpPOTwPddlGu1gjitY7bbJOS4nhImYE6A6j3d8PN +tH9d6UV+EhGB0DbtIAT/PRdByDhzy7w55Oszi21cc1/FGH3/PEuwXeBSNo3c/dUZHAr imp+z95cNQjHn+0CpNpaj5SDRdmCAXQS1jx5SMVoeLWm0uP+X7/dMCX8bYbp3PT5UofY whzA== X-Gm-Message-State: AFeK/H0cXuhOmyKBdyZE8WilbfEHzJ+s9UXSNWVBTGhE2q8cvZ17v2Euvzk+CnPdk3Kc9A== X-Received: by 10.99.151.10 with SMTP id n10mr28350118pge.199.1490672023826; Mon, 27 Mar 2017 20:33:43 -0700 (PDT) Return-Path: Received: from [192.168.0.249] (115-36-90-13.chubu1.commufa.jp. [115.36.90.13]) by smtp.gmail.com with ESMTPSA id c1sm3685985pfk.112.2017.03.27.20.33.42 for <9front@9front.org> (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Mar 2017 20:33:43 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [9front] pipe: bug or feature? From: arisawa In-Reply-To: Date: Tue, 28 Mar 2017 12:33:41 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: 9front@9front.org X-Mailer: Apple Mail (2.2104) List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: progressive anonymous DOM database YAML realtime-oriented component OK! you are right! I was careless. thanks. Kenji Arisawa > 2017/03/28 11:27=E3=80=81Alex Musolino = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A >=20 > is this a bug or a feature of pipe? >=20 > It is a bug in your code. When you do buf[n] =3D 0 in the last while > loop, you are writing past the end of buf. This causes pfd[0] to > become 0 and so the next read is actually from stdin. Making buf > larger "fixes" the problem because n=3D256 becomes a valid index. >=20 > -- > Cheers, > Alex Musolino