From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 30 Jan 2017 21:30:08 +0100 Message-Id: <20170130203008.5958-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH] genext2fs: fix off-by-one in symlink creation List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de VGhpcyBmaXhlcyBhIGZhaWx1cmUgd2hlbiBnZW5leHQyZnMgdHJpZXMgdG8gY3JlYXRlIGEgc3lt bGluayB3aGVyZSB0aGUgdGFyZ2V0CmhhcyBhIGxlbmd0aCBvZiBleGFjdGx5IDYwIGJ5dGVzLgoK U2lnbmVkLW9mZi1ieTogVXdlIEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRy b25peC5kZT4KLS0tCiAuLi54LWlub2RlLWJhc2VkLXN5bWxpbmstc3RyaW5nLWxlbmd0aC1saW1p dC5wYXRjaCB8IDM5ICsrKysrKysrKysrKysrKysrKysrKysKIHBhdGNoZXMvZ2VuZXh0MmZzLTEu NC4xL3NlcmllcyAgICAgICAgICAgICAgICAgICAgIHwgIDQgKysrCiAyIGZpbGVzIGNoYW5nZWQs IDQzIGluc2VydGlvbnMoKykKIGNyZWF0ZSBtb2RlIDEwMDY0NCBwYXRjaGVzL2dlbmV4dDJmcy0x LjQuMS8wMDAxLWZpeC1pbm9kZS1iYXNlZC1zeW1saW5rLXN0cmluZy1sZW5ndGgtbGltaXQucGF0 Y2gKIGNyZWF0ZSBtb2RlIDEwMDY0NCBwYXRjaGVzL2dlbmV4dDJmcy0xLjQuMS9zZXJpZXMKCmRp ZmYgLS1naXQgYS9wYXRjaGVzL2dlbmV4d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