]> git.sur5r.net Git - openocd/commitdiff
fix ordering of arguments to fwrite()
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 11 Jun 2009 13:00:08 +0000 (13:00 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 11 Jun 2009 13:00:08 +0000 (13:00 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2197 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/helper/ioutil.c
src/target/target.c

index 6be3e6cd5ac795142675aa622be70234e6bc6486..77e5e35682065cefe6c9ca2027ca463968a42b6d 100644 (file)
@@ -225,7 +225,7 @@ int handle_append_command(struct command_context_s *cmd_ctx, char *cmd,
 
                for (i = 1; i < argc; i++)
                {
-                       if (fwrite(args[i], strlen(args[i]), 1, config_file)!=strlen(args[i]))
+                       if (fwrite(args[i], 1, strlen(args[i]), config_file)!=strlen(args[i]))
                                break;
                        if (i != argc - 1)
                        {
index b7a4f3f80b60e231ae4e5cfbaf3799ea4b8be02b..6b8f3a0cad0dffc8e4b46e0b31fc23173bee4ab0 100644 (file)
@@ -2623,7 +2623,7 @@ static int handle_virt2phys_command(command_context_t *cmd_ctx,
 
 static void writeData(FILE *f, const void *data, size_t len)
 {
-       size_t written = fwrite(data, len, 1, f);
+       size_t written = fwrite(data, 1, len, f);
        if (written != len)
                LOG_ERROR("failed to write %zu bytes: %s", len, strerror(errno));
 }