From 4f273f1d8afac977a82460e1de174daa3e66f3f5 Mon Sep 17 00:00:00 2001 From: Shifu Chen Date: Fri, 8 Nov 2024 07:01:42 +0800 Subject: [PATCH] fix the bug of fixMGI https://github.com/OpenGene/fastp/issues/392 --- src/read.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/read.cpp b/src/read.cpp index b0f8884..04eb284 100644 --- a/src/read.cpp +++ b/src/read.cpp @@ -180,8 +180,9 @@ bool Read::fixMGI() { int len = mName->length(); if((*mName)[len-1]=='1' || (*mName)[len-1]=='2') { if((*mName)[len-2] == '/') { + string* newName = new string(mName->substr(0, len-2) + " " + mName->substr(len-2, 2)); delete mName; - mName = new string(mName->substr(0, len-2) + " " + mName->substr(len-2, 2)); + mName = newName; return true; } }