All of lore.kernel.org
 help / color / mirror / Atom feed
From: ehem+grub@m5p.com
To: grub-devel@gnu.org
Subject: Small Bug in grub-core/partmap/amiga.c
Date: Wed, 29 Dec 2010 22:29:38 -0800 (PST)	[thread overview]
Message-ID: <201012300629.oBU6TcSp022378@m5p.com> (raw)

Alas, AmigaOS has mostly passed beyond the veil, but one can still find
small bugs sometimes:

=== modified file 'grub-core/partmap/amiga.c'
--- grub-core/partmap/amiga.c	2010-03-26 14:44:13 +0000
+++ grub-core/partmap/amiga.c	2010-12-30 06:25:26 +0000
@@ -87,7 +87,7 @@
       if (grub_disk_read (disk, pos, 0, sizeof (rdsk), &rdsk))
 	return grub_errno;
 
-      if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0)
+      if (grub_strncmp ((char *) rdsk.magic, "RDSK", sizeof(rdsk.magic)) == 0)
 	{
 	  /* Found the first PART block.  */
 	  next = grub_be_to_cpu32 (rdsk.partitionlst);


I both like and dislike using strcmp() for this purpose. I kind of like
keeping it as a string, but strcmp()...   Anyway, minimal solution.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         EHeM@gremlin.m5p.com PGP F6B23DE0         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
2477\___\_|_/DC21 03A0 5D61 985B <-PGP-> F2BE 6526 ABD2 F6B2\_|_/___/3DE0




             reply	other threads:[~2010-12-30  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-30  6:29 ehem+grub [this message]
2010-12-31 13:56 ` Small Bug in grub-core/partmap/amiga.c Vladimir 'φ-coder/phcoder' Serbinenko
2010-12-31 14:08 ` Vladimir 'φ-coder/phcoder' Serbinenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201012300629.oBU6TcSp022378@m5p.com \
    --to=ehem+grub@m5p.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.