<p>Matt DeVillier has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/26597">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">arch/x86/smbios: fix whitespace trimming<br><br>Currently, the whitespace trimmer will only remove whitespace<br>at the end of a string/buffer when the length of the buffer is<br>exactly buffer_size. In practice, strlen(buffer) is often less<br>than buffer_size, so the function needs to look past any null<br>terminator until the first printable character is reached.<br><br>Test: pass in a buffer with trailing whitespace with length<br>less than buffer_size, observe whitespace correctly trimmed.<br><br>Change-Id: Ic9e458f3072ed0496cbdd37c60567d5331afd42f<br>Signed-off-by: Matt DeVillier <matt.devillier@gmail.com><br>---<br>M src/arch/x86/smbios.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/26597/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c</span><br><span>index 25a41b5..70aa1f2 100644</span><br><span>--- a/src/arch/x86/smbios.c</span><br><span>+++ b/src/arch/x86/smbios.c</span><br><span>@@ -204,7 +204,7 @@</span><br><span>                 return;</span><br><span> </span><br><span>  for (char *p = buffer + len - 1; p >= buffer; --p) {</span><br><span style="color: hsl(0, 100%, 40%);">-         if (*p == ' ')</span><br><span style="color: hsl(120, 100%, 40%);">+                if (*p <= ' ')</span><br><span>                    *p = 0;</span><br><span>              else</span><br><span>                         break;</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/26597">change 26597</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/26597"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ic9e458f3072ed0496cbdd37c60567d5331afd42f </div>
<div style="display:none"> Gerrit-Change-Number: 26597 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Matt DeVillier <matt.devillier@gmail.com> </div>