From Waclaw.Marcin.Kusnierczyk at idi.ntnu.no  Tue Apr 21 12:23:20 2009
From: Waclaw.Marcin.Kusnierczyk at idi.ntnu.no (Wacek Kusnierczyk)
Date: Tue, 21 Apr 2009 12:23:20 +0200
Subject: [Rd] sprintf limits output string length with no warning/error
	message
Message-ID: <49ED9E98.40405@idi.ntnu.no>

sprintf has a limit on the length of a string produced with a '%s'
specification:

   nchar(sprintf('%10000s', ''))
   # 8191

   nchar(sprintf('%*s', 10000, ''))
   # 8191

This is sort of documented in ?sprintf:

" There is a limit of 8192 bytes on elements of 'fmt' and also on
     strings included by a '%s' conversion specification."

but it should be a good idea for sprintf to at least warn when the
output is shorter than specified.

vQ



[Rd] sprintf limits output string length with no warning/error message
Wacek Kusnierczyk